Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7020857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:22:23+00:00 2026-05-27T23:22:23+00:00

llvm::Type 2.9 and earlier used to have getDescription method to retrieve a string representation

  • 0

llvm::Type 2.9 and earlier used to have getDescription method to retrieve a string representation of the type. This method does not exist anymore in llvm 3.0.

I’m not sure if this is deprecated in favor of Type::print(raw_ostream&), but in any case I’m curious of this API. What examples are there about how to use it? How can I dump to a string or const char*?

In particular, I want to pass the string to Boost::Format which is a modern c++ sprintf.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T23:22:24+00:00Added an answer on May 27, 2026 at 11:22 pm

    I suppose, you need to create an instance of llvm::raw_string_ostream and pass your std::string into it’s construtor. Now you can use it as llvm::raw_ostream and when you are done just call .str() to get your string.

    Something like that:

    std::string type_str;
    llvm::raw_string_ostream rso(&type_str);
    your_type->print(rso);
    std::cout<<rso.str();
    

    LLVM has changed its interface, so now the following will work:

    std::string type_str;
    llvm::raw_string_ostream rso(type_str);
    your_type->print(rso);
    std::cout<<rso.str();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know what this LLVM warning means: Method '-retry' not found (return type
Does anyone have experience with LLVM , llvm-gcc , or Clang ? The whole
Does clang/llvm have support to produce test coverage files as was the case with
I found this: Changing Compiler to llvm-clang on existing iPhone Project But that does
LLVM 2.6 + clang. Trying to compile C++ file and got: clang: warning: not
I'm using LLVM-clang on Linux. Suppose in foo.cpp I have: struct Foo { int
I have been looking at LLVM lately, and I find it to be quite
I have an LLVM (version 2.7) module with a function that takes a pointer
I have recently started experimenting with LLVM under MinGW. I have read the Kaleidoscope
With LLVM and silverlight this may be possible now (or it may be possible

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.