[cfe-dev] How to get values from AttributeList

Jonathan Roelofs jonathan at codesourcery.com
Tue Apr 21 15:05:11 PDT 2015



On 4/21/15 7:54 AM, LUIS MIGUEL SANCHEZ GARCIA wrote:
>
> llvm::APInt V = L->getValue();
> unsigned int rint = std::atoi(V.toString(10,false).c_str());

FYI, APInt has getters that sidestep the need to roundtrip through a 
string. Look for getZExtValue() and getSExtValue().


Cheers,

Jon

-- 
Jon Roelofs
jonathan at codesourcery.com
CodeSourcery / Mentor Embedded



More information about the cfe-dev mailing list