search for: getvaluename

Displaying 20 results from an estimated 29 matches for "getvaluename".

2008 Nov 23
2
[LLVMdev] RFC: Mangling Unnamed Global Values
Hi all, Right now the Mangler::getValueName() method will produce something like "__unnamed_1_37" for a global value that doesn't have a name. This is wrong for Objective-C where CFStrings will get these labels, thus preventing the linker from coalescing them. [/tmp]> nm -s __DATA __cfstring -m foo.o 00000000000244d0...
2017 Jun 12
4
How to know the sub-class of a Value class?
...how can I further use this object? I tried something like this: ================================================= Value* value = store_inst->getValueOperand() errs() << value->getValueID; // Which ID corresponds to which sub-class? errs() << value->getValueName(); // Prints numeric memory addresses errs() << *value->getValueName(); // Doesn't compile ================================================= I have mentioned the issues in each of the cases above. I am not sure if the approach is correct or not. Please help me out. -- Tha...
2008 Nov 24
0
[LLVMdev] RFC: Mangling Unnamed Global Values
Can symbols with external linkage but no name be converted to have internal linkage? Would that solve the problem? Dan On Nov 23, 2008, at 2:15 AM, Bill Wendling wrote: > Hi all, > > Right now the Mangler::getValueName() method will produce something > like "__unnamed_1_37" for a global value that doesn't have a name. > This is wrong for Objective-C where CFStrings will get these labels, > thus preventing the linker from coalescing them. > > [/tmp]> nm -s __DATA __cfstring -m foo.o...
2009 Mar 26
0
[LLVMdev] how to get the InvodInst 's Operand Name?
...> yes! i want get the name @_ZTi or @__cxa_throw, > the latter @__cxa_throw i can get it throw value->getName(), but the > @_ZTi it did n't has name! if II is the invoke instruction, you can get the names as follows: "@__cxa_throw": II->getCalledFunction()->getValueName() "@_ZTi": II->getOperand(4)->stripPointerCasts()->getValueName() The first one won't work for indirect calls. The second one won't work in more complicated situations. Why do you want the names anyway? Ciao, Duncan.
2009 Mar 26
2
[LLVMdev] how to get the InvodInst 's Operand Name?
Hi Duncan, >>are you trying to get the name "@_ZTIi" or "@__cxa_throw"? yes! i want get the name @_ZTi or @__cxa_throw, the latter @__cxa_throw i can get it throw value->getName(), but the @_ZTi it did n't has name! zhangzw thanks 2009/3/26 Duncan Sands <baldrick at free.fr>: > Hi zhangzw, > >> invoke void @__cxa_throw(i8* %7, i8*
2012 Jul 09
1
[LLVMdev] Problem with getting a result of an instruction.
...at example we use virtual register 0) and my pass cannot do it. I'm using the following piece of code in my pass: for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I){ if((*I).getOpcode() == Instruction::Load){ errs() << cast<LoadInst>(*I).getValueName() << "\n"; } } The method getValueName() gives nothing as well as getName() or getValueID(). Because of this I'm not able to detect that b is dependent on a. However if I have something like this: store i32 0, i32* %a, align 4 %tmp = load i32* %a, align 4...
2008 Nov 24
2
[LLVMdev] RFC: Mangling Unnamed Global Values
...n <gohman at apple.com> wrote: > Can symbols with external linkage but no name be converted > to have internal linkage? Would that solve the problem? > > Dan > > On Nov 23, 2008, at 2:15 AM, Bill Wendling wrote: > >> Hi all, >> >> Right now the Mangler::getValueName() method will produce something >> like "__unnamed_1_37" for a global value that doesn't have a name. >> This is wrong for Objective-C where CFStrings will get these labels, >> thus preventing the linker from coalescing them. >> >> [/tmp]> nm -s __DATA...
2018 Mar 09
4
Dump LLVM StoreInst
Hi, I’m writing a loop-free LLVM pass, my thought is to track if the value inside the loop is changed, so I look up the Instruction StoreInst first and try to get its value in a set. I checked getValueOperand(), getValueName() in the API document but unfortunately they failed the compilation. if (isa<StoreInst>(I)){ Value* v = I.getOperand(0); Instruction* op1 = dyn_cast<Instruction>(v); errs()<< v << "\t" << v1-getName()<<"\t"<<op<<\n&quo...
2017 Jun 12
4
How to know the sub-class of a Value class?
...is: >> >> ================================================= >> >> Value* value = store_inst->getValueOperand() >> errs() << value->getValueID; // Which ID corresponds to which >> sub-class? >> errs() << value->getValueName(); // Prints numeric memory >> addresses >> errs() << *value->getValueName(); // Doesn't compile >> >> ================================================= >> >> I have mentioned the issues in each of the cases above. I am not sure if >>...
2013 Jan 10
2
[LLVMdev] LLVM Instruction*->getOperand() not working properly for ICMP
...type Instruction*. Due tests based on getNumOperands, ICMP has 2 (as normal). if ( ok && ((previous->getNumOperands())>=2) ) errs()<<"\nTTTTT "<<previous->getOperand(0)->getName()<<" | " <<previous->getOperand(0)->getValueName()<<" | " <<previous->getOperand(0)->getValueID()<<" | " <<previous->getOperand(0)->getNumUses()<<" TTTTT\n"; The results with getOperand(1) are similar. The output is: *PREVIOUS: store i32 %conv15, i32*...
2018 Mar 10
0
Dump LLVM StoreInst
...AM, Zhou Zhizhong via llvm-dev <llvm-dev at lists.llvm.org> wrote: > Hi, > > I’m writing a loop-free LLVM pass, my thought is to track if the value inside the loop is changed, so I look up the Instruction StoreInst first and try to get its value in a set. I checked getValueOperand(), getValueName() in the API document but unfortunately they failed the compilation. > If you want to check for loop invariance, LICM has logic for doing what you want. To track the evolution of a variable inside a loop, there's already an analysis, ScalarEvolution. In general, I'd recommend to check h...
2005 Jul 03
1
[LLVMdev] How do you determine whether a functionisdefinedexternally to a module ?
I have tried the following :- if (!M.empty()) for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) if ( !I->getIntrinsicID() && I->getEntryBlock().empty()) O << "EXTERN " << Mang->getValueName(I) << " : NEAR" << "\n"; Based upon :- virtual bool Function::isExternal() const { return BasicBlocks.empty(); } But it does not work either. Which means there must be a BasicBlock occuring on undefined/external functions. Anyway no hurry I am off to do othe...
2006 Dec 06
2
[LLVMdev] weak linkage
...on the X86 and PPC backends: ------------------------------------------------ // If the initializer is a extern weak symbol, remember to emit the weak // reference! if (const GlobalValue *GV = dyn_cast<GlobalValue>(C)) if (GV->hasExternalWeakLinkage()) ExtWeakSymbols.insert(Mang->getValueName(GV)); ------------------------------------------------ Can a initializer be a weak reference? For example, ------------------------ int a __attribute__ ((weak)); int b = a; ------------------------ fails to compile with the error: test.c:2: error: initializer element is not constant Best Regards,...
2011 Oct 17
2
[LLVMdev] Variable name from metadata
Hi All,   Can we extract name of variable name from "MDNode" ?   1. Neither temp_MDNode->getName() nor temp_MDNode->getValueName() give me "global_int" which is name of a variable.   2. I tried below ways as well. DIVariable DV(mdnode1); Value *v = mdnode1->getOperand(0);//gives add 0x69   3. I have written below code to reach till variable name.        LLVMIname is                 const CallInst *CI = dyn_cas...
2009 Mar 26
2
[LLVMdev] how to get the InvodInst 's Operand Name?
...e name @_ZTi or @__cxa_throw, >> the latter @__cxa_throw i can get it throw value->getName(), but the >> @_ZTi it did n't has name! > > if II is the invoke instruction, you can get the names as follows: > > "@__cxa_throw": II->getCalledFunction()->getValueName() > "@_ZTi": II->getOperand(4)->stripPointerCasts()->getValueName() > > The first one won't work for indirect calls. The second one > won't work in more complicated situations. Why do you want > the names anyway? > > Ciao, > > Duncan. >
2010 Jul 29
0
[LLVMdev] inline asm constraints in LLVM
The LLVM asm parser doesn't support multiple alternative constraints; you need to have Clang pick one tuple in the front end. See ChooseConstraintTuple in llvm-gcc for prior art. On Jul 29, 2010, at 11:36 AMPDT, John Thompson wrote: > I'm trying to fix the handling of multiple alternate constraints in > Clang (see
2010 Jul 29
3
[LLVMdev] inline asm constraints in LLVM
I'm trying to fix the handling of multiple alternate constraints in Clang (see http://gcc.gnu.org/onlinedocs/gcc/Multi_002dAlternative.html#Multi_002dAlternative ). How should the constraints be represented in the .ll file? Clang currently will assert because the code generator sees a constraints string with the wrong number of comma-separated items. Basically, after some editing, it just
2017 Jun 12
2
How to know the sub-class of a Value class?
...is: >> >> ================================================= >> >> Value* value = store_inst->getValueOperand() >> errs() << value->getValueID; // Which ID corresponds to which >> sub-class? >> errs() << value->getValueName(); // Prints numeric memory >> addresses >> errs() << *value->getValueName(); // Doesn't compile >> >> ================================================= >> >> I have mentioned the issues in each of the cases above. I am not sure if >>...
2005 Jul 03
4
[LLVMdev] How do you determine whether a function is definedexternally to a module ?
> Something like this should work: > > for (Module::iterator F = M->begin(), E = M->end(); F != E; ++F) > if (F->isExternal()) > ... Function* F is external! ... This is not working. For some reason there is a BasicBlock present on undefined functions ! I am compiling the examples from llvm/test/feature, about 28 out of 34 assemble fine. Just cannot seem to get
2013 Jan 10
0
[LLVMdev] LLVM Instruction*->getOperand() not working properly for ICMP
...t; based on getNumOperands, ICMP has 2 (as normal). > > |if ( ok && ((previous->getNumOperands())>=2) ) > > errs()<<"\nTTTTT "<<previous->getOperand(0)->getName()<<" | " > <<previous->getOperand(0)->getValueName()<<" | " > <<previous->getOperand(0)->getValueID()<<" | " > <<previous->getOperand(0)->getNumUses()<<" TTTTT\n"; > | > > The results with getOperand(1) are similar. The output is: > >...