[cfe-dev] How to get values from AttributeList

LUIS MIGUEL SANCHEZ GARCIA luismiguel.sanchez at uc3m.es
Wed Apr 22 00:04:41 PDT 2015


Thanks for your advise.

Regards,
Luis

2015-04-22 0:05 GMT+02:00 Jonathan Roelofs <jonathan at codesourcery.com>:

>
>
> 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
>



-- 
-- 
-- 
--------------------------------------------------
Luis Miguel Sánchez García
Computer Architecture and Technology Area.
Office 2.2.B08
Computer Science Department. UNIVERSIDAD CARLOS III DE MADRID
Universidad Carlos III de Madrid
Avda. de la Universidad, 30
28911 Leganés - Madrid - Spain
e-mail: lmsan at arcos.inf.uc3m.es
        luismiguel.sanchez at uc3m.es

Phone: (+34) 91 624 5951

Linked-In: http://es.linkedin.com/in/lmsan
Twitter: http://twitter.com/lmsanchezgarcia
--------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150422/d2ed34c7/attachment.html>


More information about the cfe-dev mailing list