search for: getnamestr

Displaying 20 results from an estimated 40 matches for "getnamestr".

2011 May 20
3
[LLVMdev] convert a char * to a value
...kes 2 arguments with type char *: void branchPredict(char *b1, char *b2){ --- -- } i'm supposed to add this method, in an IR basic bloc: to add it into a basic bloc i do: //i: is the basic bloc std::vector<Value*> void_43_params; Constant* tbname = ConstantArray::get(M.getContext(),i->getNameStr() , true); Constant* pbname = ConstantArray::get(M.getContext(), i->getPrevNode()->getNameStr(), true); void_43_params.push_back(tbname); void_43_params.push_back(pbname); CallInst* void_43 = CallInst::Create(func_branchPredict, void_43_params.begin(), void_43_params.end(), "", i-&...
2013 Aug 28
2
[LLVMdev] [polly] one more slow pretty printing in the default path
Hi, in lib/Analysis/RegionPass.cpp there are 3 occurrences of: CurrentRegion->getNameStr() These are slowing down compile times with polly. I would suggest to either remove these calls, or only turn on when the programmer asks for -debug. The reason for the slow pretty printing of types is the same as previously discussed in: http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-July/063755...
2010 Apr 15
3
[LLVMdev] How to extract Left Hand side of Instruction
Hi, Suppose I have llvm Instruction as : %9 = load i32* %b, align 4 and I want to extract the name of temporary value used here ie 9. Can any body tell that how can I do that? thanks and regards, Ambika
2013 Aug 28
0
[LLVMdev] [polly] one more slow pretty printing in the default path
On 08/28/2013 10:08 AM, Sebastian Pop wrote: > Hi,tic > > in lib/Analysis/RegionPass.cpp there are 3 occurrences of: > CurrentRegion->getNameStr() > These are slowing down compile times with polly. > I would suggest to either remove these calls, > or only turn on when the programmer asks for -debug. > > The reason for the slow pretty printing of types is the same as > previously discussed in: > http://lists.cs.uiuc.edu/...
2011 May 20
0
[LLVMdev] convert a char * to a value
...ions for getting it from SVN are at http://safecode.cs.illinois.edu under the Download link). I think it is similar to what you want to do. -- John T. > > //i: is the basic bloc > std::vector<Value*> void_43_params; > Constant* tbname = ConstantArray::get(M.getContext(),i->getNameStr() , > true); > Constant* pbname = ConstantArray::get(M.getContext(), > i->getPrevNode()->getNameStr(), true); > void_43_params.push_back(tbname); > void_43_params.push_back(pbname); > CallInst* void_43 = CallInst::Create(func_branchPredict, > void_43_params.begin(), v...
2009 Nov 13
1
[LLVMdev] dodgy use of c_str()
...;From llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp: void DebugInfo::EmitGlobalVariable(GlobalVariable *GV, tree decl) { // Gather location information. expanded_location Loc = expand_location(DECL_SOURCE_LOCATION(decl)); DIType TyD = getOrCreateType(TREE_TYPE(decl)); const char *DispName = GV->getNameStr().c_str(); Isn't this use of c_str() dodgy, because the temporary string returned by Gv->getNameStr() will be destroyed at the end of the expression, so it's no longer valid to use the memory pointed to by DispName? Thanks, Jay.
2010 Apr 15
0
[LLVMdev] How to extract Left Hand side of Instruction
ambika wrote: > Hi, > > Suppose I have llvm Instruction as : > > %9 = load i32* %b, align 4 > > and I want to extract the name of temporary value used here ie 9. > Can any body tell that how can I do that? > I believe it's the getNameStr() method. Note that not all instructions have names (i.e., getNameStr() might give you an empty string). I think the LLVM disassembler prints a number when the instruction has no name. There's a pass which, I think, gives names to all values, but I don't recall the pass's name. -...
2010 Jul 15
1
[LLVMdev] Figuring out the parameters of the Call Instruction
Hi Duncan, Thanks for pointing out my mistake. I will reword my questions. //C code int var1; //global int a, b; foo(a, b); bar(c); generates following //LLVM IR %1 = load a; %2 = load b; call foo(%1, %2) call bar(@var1) CallInst.getOperand(1).getNameStr() on foo, returns null, but on bar returns var1. Similarly, for call void @p_ptr(i64 ptrtoint (%struct.my_struct* @abc to i64)) nounwind, !dbg !31 CallInst.getOperand(1).getNameStr(), return abc and type returns i64, How do I figure the operand is a const expression and a cast operator was used...
2009 Apr 30
2
[LLVMdev] Pulling line number/file/path information from DbgStopPointInst instructions
...own entry points in an opt pass, but it's currently failing to get the file name and path back, though it is still correctly getting line numbers. If you happen to have a code fragment that is known to work, it would be much appreciated. What it used to work was calling getFileName()->getNameStr() on the DbgStopPointInst, which returned a std::string, but in LLVM 2.5 the code compiles, but that string is empty. Any clues? [s]
2011 Jul 06
2
[LLVMdev] First steps with LLVM and partial evaluation
...//******************************************************************************* void specializeFunction(Module& m, Function& f, LLVMContext& context) { ValueToValueMapTy valueMap; Function *specFunc = cloneFunctionInfo(&f, valueMap); specFunc->setName(specFunc->getNameStr() + "_spec"); for (Function::arg_iterator j = f.arg_begin(); j != f.arg_end(); ++j) { Argument* arg = j; Value* val; if (arg->getNameStr() == "n") { val = ConstantInt::get(Type::getInt32Ty(context), 3); valueMap[arg] = v...
2010 Jun 21
1
[LLVMdev] Casting a Value
Hi, I have Value V of Type i32*. How can I convert/set it's Type to i32? Or How can I create another Value of Type i32 and with same name as V. I have tried Value *NewV = new Value(Type,scid); NewV->setName(V->getNameStr()); It causes stack dump. I am not sure as second argument in the Value constructor as scid (SubClassID). So I have mentioned 0. Any Idea how to do this? Regards, Chayan
2010 Jul 15
0
[LLVMdev] Figuring out the parameters of the Call Instruction
Hi Shankha, > 24 p_ptr ((unsigned long)&abc); > call void @p_ptr(i64 ptrtoint (%struct.my_struct* @abc to i64)) > nounwind, !dbg !31 > > Q.1 At line no 24 I try to read the address of global variable abc. > The address is type casted > from struct * to int * for which ptrtoint. I guess you mean "is type casted from struct * to unsigned
2009 Mar 12
0
[LLVMdev] Suggestion: include object data in assertion messages
...reference and something is wrong. This code is here to print out what is // still being referenced. The value in question should be printed as // a <badref> // if (!use_empty()) { cerr << "While deleting: " << *VTy << " %" << getNameStr() << "\n"; for (use_iterator I = use_begin(), E = use_end(); I != E; ++I) cerr << "Use still stuck around after Def is destroyed:" << **I << "\n"; } #endif assert(use_empty() && "Uses remain when a valu...
2009 Apr 30
0
[LLVMdev] Pulling line number/file/path information from DbgStopPointInst instructions
...DwarfWriter::getOrCreateSourceID is used. Unfortunately, I don't see how to get the file name from a DbgStopPointInstr right offhand. Things in the CodeGen/AsmPrinter/DwarfWriter.cpp file have changed quite a bit in recent months... -bw > What it used to work was calling getFileName()->getNameStr() on the > DbgStopPointInst, which returned a std::string, but in LLVM 2.5 the > code compiles, but that string is empty. Any clues? > > [s] > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu...
2009 Mar 12
2
[LLVMdev] Suggestion: include object data in assertion messages
Hi all, There are many assertions sprinkled throughout the llvm codebase, which is a GoodThing. Most of the assertions even have informative messages, which is a BetterThing. However, assertion messages are static strings, and don't include any information about the particular object/value which caused the assertion. In a 'data oriented' system like llvm, this makes it really
2010 Jul 14
2
[LLVMdev] Figuring out the parameters of the Call Instruction
Hi, I am trying to figure out how to read arguments of a call instruction. I had few questions based on that I have the following C Code 1 #include <stdio.h> 2 3 struct my_struct 4 { 5 int a; 6 int b; 7 }; 8 9 struct my_struct abc; 10 void p_ptr ( unsigned long j) 11 { 12 printf ( "%lx \n", j ); 13 } 14 15 void struct_ptr ( struct my_struct *
2011 Dec 06
1
[LLVMdev] Problem with IR code instruction
...ving some trouble with an IR instruction. I'm triying to modify it. I was trying to create a BinaryOperator "op" with some operands from Instruction "inst": op = BinaryOperator::Create(Instruction::Add,cast<Value>(inst->getOperand(0)),cast<Value>(r),inst->getNameStr(),inst); But when executed, my pass throw a segfault and a stacktrace: ../build/Release/bin/clang -emit-llvm -c -I./testprof/ -I./src/headers/ -I../libtommath-0.42.0/ -Wall Wsign-compare -W -Wshadow -Wno-unused-parameter -DLTC_SOURCE -DLTC_NO_ASM -DUSE_LTM -DLTM_DESC -DENCRYPT_ONLY -c src/ciphe...
2008 Aug 06
2
[LLVMdev] crash in JIT when running the inliner
...basic_string<const char*> (this=0xbf856eb4, __beg=0x9fe020c "!I4\thC6\tH#6\nçÃ6\npÆF·+", __end=0x13344334 <Address 0x13344334 out of bounds>, __a=@0xbf856e3f) at /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4/bits/basic_string.tcc:241 #6 0xb730198b in llvm::Value::getNameStr (this=0x9344910) at Value.cpp:162 #7 0xb6d8c641 in llvm::Value::getName (this=0x9344910) at /cvs/llvm/include/llvm/Value.h:110 #8 0xb6f241c7 in (anonymous namespace)::JITResolver::JITCompilerFn (Stub=0xb5667620) at JITEmitter.cpp:267 #9 0xb6de70e4 in X86CompilationCallback2 (StackPtr=0xbf856f6...
2010 Jun 05
1
[LLVMdev] Why asserts don't provide much information?
...ng // reference and something is wrong. This code is here to print out what is // still being referenced. The value in question should be printed as // a <badref> // if (!use_empty()) { dbgs() << "While deleting: " << *VTy << " %" << getNameStr() << "\n"; for (use_iterator I = use_begin(), E = use_end(); I != E; ++I) dbgs() << "Use still stuck around after Def is destroyed:" << **I << "\n"; } #endif assert(use_empty() && "Uses remain when a value i...
2011 Feb 22
2
[LLVMdev] Clone a function and change signature
...I have a callInstruction CI, which I want to transform to call this new function, and to take a new argument. The code I added was as follows CI->getCalledFunction()->dump(); Function* DirectF = CloneFunction(CI->getCalledFunction()); DirectF->setName(CI->getCalledFunction()->getNameStr() + "_SPEC"); DirectF->setLinkage(GlobalValue::InternalLinkage); // add the extra argument new Argument(GEP->getPointerOperand()->getType(),"arg",DirectF); M.getFunctionList().push_back(DirectF); DirectF->dump(); SmallVector<Value*, 8> Args; for(unsign...