Displaying 2 results from an estimated 2 matches for "756e6575".
2013 May 02
0
[LLVMdev] int to StringRed conversion
Hi,
I think you may try to use llvm::Twine(int). For example, to convert 30
to string, you can use:
Twine(30).str()
To convert the string back to integer, you can try the
StringRef::getAsInteger(unsigned, APInt &). For example:
APInt i;
str.getAsInteger(/*radix=*/ 10, /*output=*/ i);
Sincerely,
Logan
On Thu, May 2, 2013 at 9:53 PM, Alexandru Ionut Diaconescu <
2013 May 02
4
[LLVMdev] int to StringRed conversion
Hello everyone,
I have an integer and I want to convert it to StringRef in order to set
metadata.
setMetadata->(StringRef, MDNode*);
It is there a native LLVM way to do it?
1. In the llvm::APSInt Class is toString() method, which seems it is not
for this purpose
2. itoa and string are not part of LLVM
3. stringstream is not part of LLVM
4. to_string is not part of LLVM
5. any casting method?