search for: getintegerbitwidth

Displaying 3 results from an estimated 3 matches for "getintegerbitwidth".

2015 Jan 22
2
[LLVMdev] access IntegerType::getSignBit from Type *
Hi, I have a Type * which may come from an IntegerType as shown below: Type.getIntegerBitWidth() tells me numBits. But how to extract the IntegerType.getSignBit? If pType isIntegerType, I need to know if it is signed or unsigned... How to achieve this? Thx Alex llvm::Type * getRandomValid_IntegerType(llvm::LLVMContext &C) { using namespace llvm; //--- determine num of bit...
2012 Nov 11
1
[LLVMdev] bits in a pointer
When I have to do arithmetic, using APInt, with the component parts of a SCEV *X, I've been using X->getType()->getIntegerBitWidth() to tell me how many bits to allocate in my APInts. Now I've come across a case where the SCEV has a pointer type. How can I find the width of a pointer in bits? Thanks, Preston -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermai...
2017 May 29
2
Print 128 bit value at runtime using printf
.../questions/5315176/llvm-get-constant-integer-back-from-value ) //========= Relevant code below ========== Value* val = e->codegen() ; if(!val) { return logError("Error evaluating argument to function call"); } if(val->getType()->isIntegerTy() ) { if(val->getType()->getIntegerBitWidth() <= 64) { tempString = tempString + "%+d,"; } // Is this correct ? else { if(ConstantInt* CI = dyn_cast<ConstantInt>(val)) { // base 10 and signed std::string res = CI->getValue().toString(10,true); val=Builder.CreateGlobalStringPtr(res,"str&q...