search for: getfunct

Displaying 20 results from an estimated 360 matches for "getfunct".

Did you mean: getfuncs
2012 Sep 24
0
[LLVMdev] [llvm-commits] Fwd: Re: [PATCH] Fix for bug in JIT exception table allocation
...ufferBegin; > > > > SavedBufferEnd = BufferEnd; > > > > SavedCurBufferPtr = CurBufferPtr; > > > > + uint8_t *FrameRegister; > > > > > > > > - BufferBegin = CurBufferPtr = > > > > MemMgr->startExceptionTable(F.getFunction(), > > > > - ActualSize); > > > > - BufferEnd = BufferBegin+ActualSize; > > > > - EmittedFunctions[F.getFunction()].ExceptionTable = BufferBegin; > > > > - uint8_t *EhStart; >...
2016 Jan 20
2
Why getFunction() of CallGraphNode return NULL function?
...ndirect callSite > (unless not de-virtualized). > > > > Regards, > > Ashutosh > > > > *From:* Qiuping Yi [mailto:yiqiuping at gmail.com] > *Sent:* Wednesday, January 20, 2016 9:10 AM > *To:* Nema, Ashutosh > *Cc:* llvm-dev > *Subject:* Re: [llvm-dev] Why getFunction() of CallGraphNode return NULL > function? > > > > Dear Ashutosh, > > > > Thank you, I can handle some indirect callSites by getFunction() of > InvokInst and CallInst. > > > > However, when I am handling C++ programs, I found the calls of member > fun...
2016 Jan 20
2
Why getFunction() of CallGraphNode return NULL function?
Dear Ashutosh, Thank you, I can handle some indirect callSites by getFunction() of InvokInst and CallInst. However, when I am handling C++ programs, I found the calls of member functions are converted to some strange indirect calls. For example: table->truncate(sysTransaction); // from mysql are translated to the next complex llvm IR: _ZN8Database20getSystemTran...
2016 Jan 19
2
Why getFunction() of CallGraphNode return NULL function?
...ns of each CallGraphNode in CallGraph as follow: for (CallGraph::iterator it = CG->begin(); it != CG->end(); ++it) { CallGraphNode* node = it->second; for (CallGraphNode::iterator it2 = node->begin(); it2 != node->end(); ++it2) { Function* calledFunc = it2->second=>getFunction(); cerr << ”function: “ << calledFunc->getName().str() <<"\n"; *// crash some times* ... ... ... ... } } I found that some time "calledFunc" is NULL function and thus the output crash. I don't known why? If the before code is w...
2011 Jul 23
1
[LLVMdev] getFunction() of DISubprogram return 0?
Hi, I'd like to get the Function* that is described by a DISubprogram. I found this method getFunction() in the class. However, when I use it in my code, the function always returns 0. I tried to dig into it and saw that a mysterious number 16 is used in getFunctionField(16). I'm wondering if my failure of the function was caused by my incorrect use, e.g., without fulfilling necessary ass...
2011 Mar 31
3
[LLVMdev] inserting exit function into IR
Hi Joshua, I have a function foo and I want to insert exit(0) at the end of foo. The problem is M.getFunction returns null, which is understandable. I am not sure what to do. Below is the code snippet. void foo(int argc, char* argv[]) { printf("hello world\n"); exit(0); //***I want to insert this exit } My llvm code snippet is vector<const Type *> params = vector<const Type *&g...
2012 Aug 17
3
[LLVMdev] Problem of use CallGraph
...{ AU.addRequired<CallGraph>(); } virtual bool runOnModule(Module &F) { CallGraph &g = getAnalysis<CallGraph>(); for ( CallGraph::iterator i = g.begin(); i != g.end(); i++) { errs()<<"-----------------\n"; errs()<<i->second->getFunction()->getName()<<"\n"; } return false; } Compile: g++ -fPIC -shared `llvm-config --cxxflags` -o MPIAnalysis.so MPIAnalysis.cpp, when I use following command to run: opt -load ./MPIAnalysis.so -hello < main it shows the error: ----------------- 0 opt 0x085cddc8 Sta...
2019 Jan 13
2
Problem using BlockFrequencyInfo's getBlockProfileCount
...   }     auto& bfiPass = getAnalysis<BlockFrequencyInfoWrapperPass>(F);     llvm::BlockFrequencyInfo* BFI = &bfiPass.getBFI();     //Works - shows all info I want     BFI->print(llvm::dbgs());     for (const llvm::BasicBlock& B : F) {         //Fails with SIGSEGV -> *getFunction() returns 0xa         dbgs() << BFI->getBlockProfileCount(&B).getValueOr(0) << "\n";     } } lib/Analysis/BlockFrequencyInfo.cpp#L211 return BFI->getBlockProfileCount(*getFunction(), BB);
2007 Sep 20
0
[LLVMdev] Valgrind Help Needed
....mi:12: internal compiler error: Bus error > Please submit a full bug report, > with preprocessed source if appropriate. > See <URL:http://llvm.org/bugs> for instructions. In llvm-backend.cpp : 1086 if (GV->getName() != Name) { 1087 Function *F = TheModule->getFunction(Name); 1088 assert(F && F->isDeclaration() && "A function turned into a global?"); 1089 1090 // Replace any uses of "F" with uses of GV. 1091 Value *FInNewType = ConstantExpr::getBitCast(GV, F- >getType()); (gdb) p Na...
2007 Dec 25
3
[LLVMdev] Using debug info in static analysis
Hi, I was looking at how to use debug info to find out original source:line for a certain function/variable in the llvm bytecode. I read http://llvm.org/docs/SourceLevelDebugging.html, and then I have looked in lib/Debugger/ProgramInfo.cpp. getFunction() looks useful, however I am not sure how to call it. I have a reference to a Function, however getFunction() takes a GlobalVariable. I tried creating a GlobalVariable that points to my Function, but that didn't work, since getFunction() is looking at uses of the GlobalVariable, which in my...
2008 Aug 11
2
[LLVMdev] Applying different Optimizations for different Functions - Questions?
...zations for selected functions. For example, I want to apply an optimization onto one function but not for another one. I am using the standard optimizations available in LLVM. That is the runOnModule function I have written: bool ComplNewBBFuncs::runOnModule(Module &M) { Function *Main = M.getFunction("main"); if (Main == 0) { cerr << "!!! No Main Function" << std::endl; return false; } //Determine each Function LoopPass * UnrollLoops; FunctionPass *DeadStoreElim; LPPassManager *LPPM; Function *CurFunc1 = M.getFunction("Ne...
2012 Aug 17
0
[LLVMdev] Problem of use CallGraph
...begin(); i != g.end(); i++) > { > errs()<<"-----------------\n"; You may try something like this: if (CallGraphNode *CGN = i->second) ... CGN->getFunction()->getName() ... > errs()<<i->second->getFunction()->getName()<<"\n"; > } > return false; > } > > Compile: > g++ -fPIC -shared `llvm-config --cxx...
2007 Sep 19
3
[LLVMdev] Valgrind Help Needed
Hi all, This program: @protocol CPTransferThreadObserving; @interface CPMode {} @end @implementation CPMode -(void) copyInBackgroundAndNotifyUsingPorts { id client; [client setProtocolForProxy: @protocol(CPTransferThreadObserving)]; } @end produces this internal compiler error: $ llvm-gcc -x objective-c -arch ppc64 -std=c99 -c testcase.mi testcase.mi:12: internal compiler
2013 Nov 21
1
[LLVMdev] Replacing C-style function
...llptr )<<"Execution engine is nullptr:"<<errMsg; At this point, I am able to retrieve pointers to all the 3 functions (print1, print2 and mainOfLibrary) correctly and execute them as well, e.g: //check the print1f is behaving properly llvm::Function *print1f = main->getFunction( "print1" ); ASSERT_NE( print1f, nullptr ); void *print1fPtr = ee->getPointerToFunction( print1f ); int ret = ((int(*)(void))(print1fPtr))(); EXPECT_EQ(0xdeadbeef, ret); However, when i try to replace the use of print1 with print2, it doesn't seem to work correctly....
2007 Sep 20
2
[LLVMdev] Valgrind Help Needed
...s error >> Please submit a full bug report, >> with preprocessed source if appropriate. >> See <URL:http://llvm.org/bugs> for instructions. > > In llvm-backend.cpp : > > 1086 if (GV->getName() != Name) { > 1087 Function *F = TheModule->getFunction(Name); > 1088 assert(F && F->isDeclaration() && "A function turned > into a global?"); > 1089 > 1090 // Replace any uses of "F" with uses of GV. > 1091 Value *FInNewType = ConstantExpr::getBitCast(GV, F- >...
2011 Mar 30
2
[LLVMdev] inserting exit function into IR
Hi Everyone, I am trying to insert an exit function into my IR. However, I thought I can get access to exit by using Module.getOrInsertFunction or Module.getFunction. However, I am getting a null value returned. I have searched through the llvmdev archives but not found any thing that addresses this question. Any help will be greatly appreciated. Thanks. George -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists...
2008 Jan 26
0
JRuby version of win32-api - initial try
...ards, Dan require ''java'' # The Win32 module serves as a namespace only. module Win32 class API class Error < StandardError; end private KERNEL32 = com.sun.jna.NativeLibrary.getInstance(''kernel32'') LoadLibrary = KERNEL32.getFunction(''LoadLibraryA'') GetProcAddress = KERNEL32.getFunction(''GetProcAddress'') FormatMessageA = KERNEL32.getFunction(''FormatMessageA'') LocalFree = KERNEL32.getFunction(''LocalFree'') public V...
2008 Mar 30
3
[LLVMdev] Being able to know the jitted code-size before emitting
Hi everyone, vmkit requires to know the size of a jitted method before emitting the method. This allows to allocate the correct size for the method. The attached patch creates this functionality when the flag SizedMemoryCode is on. In order to implement this functionality, i had to virtualize some MachineCodeEmitter functions. Is it OK to commit the patch? Thanks, Nicolas --------------
2011 Mar 31
0
[LLVMdev] inserting exit function into IR
On Thu, Mar 31, 2011 at 9:31 PM, George Baah <georgebaah at gmail.com> wrote: > Hi Joshua, >       I have a function foo and I want to insert exit(0) at the end of foo. > The problem is M.getFunction returns null, which is understandable. I am not > sure what to do. Below is the code snippet. > void foo(int argc, char* argv[]) { >   printf("hello world\n"); >   exit(0); //***I want to insert this exit > } > My llvm code snippet is > > vector<const Type *&...
2011 Oct 19
1
[LLVMdev] CallGraphSCC
...to access the instructions via: CallGraph->CallGraphNode->Function->BB->Instruction Is this possible? Right now, I'm iterating over the CallGraph Nodes via CallGraphSCC:iterator, but then I have to cast that iterator to a CallGraphNode const and then when I call CallGraphNode->getFunction, it returns a valid function but seg faults on function->getName()? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111019/408766ae/attachment.html>