search for: getmoduleidentifier

Displaying 20 results from an estimated 27 matches for "getmoduleidentifier".

2008 Nov 18
2
[LLVMdev] getModuleIdentifier() returns <stdin>
Hi all, I'm writing my own pass and use "opt" to launch it. In my pass, I'd like to see the name of the module I'm working on, so I use getModuleIdentifier(), trying to get the name such as "test.bc." But the result is always <stdin>. Could anyone please help me on this? Thank you very much. Jack -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/2...
2008 Nov 18
0
[LLVMdev] getModuleIdentifier() returns <stdin>
Jack Tzu-Han Hung wrote: > Hi all, > > I'm writing my own pass and use "opt" to launch it. In my pass, I'd like to see the name of the module I'm working on, so I use getModuleIdentifier(), trying to get the name such as "test.bc." But the result is always <stdin>. > > Could anyone please help me on this? > Is opt reading the input bitcode from standard input (as opposed to being given a filename)? If so, that is probably why the module is named stdin...
2008 Nov 18
3
[LLVMdev] getModuleIdentifier() returns <stdin>
...2008 at 10:23 AM, John Criswell <criswell at cs.uiuc.edu>wrote: > Jack Tzu-Han Hung wrote: > > Hi all, > > > > I'm writing my own pass and use "opt" to launch it. In my pass, I'd like > to see the name of the module I'm working on, so I use > getModuleIdentifier(), trying to get the name such as "test.bc." But the > result is always <stdin>. > > > > Could anyone please help me on this? > > > Is opt reading the input bitcode from standard input (as opposed to > being given a filename)? If so, that is probably why...
2011 Jul 07
0
[LLVMdev] Filename in dynamically loaded function pass
...ile, not the bc file being processed, which is fine for my use case). But > sometimes, the instruction may refer to code from a system header file and > hence will not return the name of the file that’s currently being processed. > > Is there a way to get this info? There's Module::getModuleIdentifier()[1], which *usually* contains the file name if the module was loaded from a bitcode file on disk. Since you're writing a function pass, it should be accessible as 'F.getParent()->getModuleIdentifier()'. This is not always the case, however. For instance, if the module was read from...
2011 Jul 07
2
[LLVMdev] Filename in dynamically loaded function pass
Hi All, I would like to know if there is an API/method that I can use to get the name of the file being processed in a dynamically loaded function pass. In other words, if I invoke a pass as follows opt -load pass.so -hello src.bc -o src.hello.bc where pass.so is a functionpass, I would like to get the filename "src.bc", in the doInitialization/doFinalization method. My intent is to
2012 Jun 01
0
[LLVMdev] [llvm-commits] [PATCH] Allow per-thread re-direction of outs()/errs()
..."WARNING: Linking two modules of different data layouts!\n"; if (!SrcM->getTargetTriple().empty() && DstM->getTargetTriple() != SrcM->getTargetTriple()) { errs() << "WARNING: Linking two modules of different target triples: "; if (!SrcM->getModuleIdentifier().empty()) errs() << SrcM->getModuleIdentifier() << ": "; errs() << "'" << SrcM->getTargetTriple() << "' and '" << DstM->getTargetTriple() << "'\n"; } Would I be correc...
2016 Jul 07
2
ObjectCache and getFunctionAddress issue
...nted the object cache as follow: class EngineObjectCache : public llvm::ObjectCache { private: std::unordered_map<std::string, std::unique_ptr<llvm::MemoryBuffer>> CachedObjs; public: virtual void notifyObjectCompiled(const llvm::Module *M, llvm::MemoryBufferRef Obj) { auto id = M->getModuleIdentifier(); auto iter = CachedObjs.find(id); if (iter == CachedObjs.end()) { auto buf = llvm::MemoryBuffer::getMemBufferCopy(Obj.getBuffer(), Obj.getBufferIdentifier()); CachedObjs.insert(std::make_pair(id, std::move(buf))); } }; virtual std::unique_ptr<llvm::MemoryBuffer> getObject(const llvm::Module...
2015 Mar 05
4
[LLVMdev] global variable
Hi all, I am newbie for llvm. I just create a global variable, there are some statements in my pass like: LoadInst* int64_64 = new LoadInst(pthreadPID, "", false, OptAplusOne); int64_64->setAlignment(8); int64_64->dump(); LoadInst* int32_65 = new LoadInst(gvar_int32_myFlag, "", false, OptAplusOne); int32_65->setAlignment(4);
2012 Jun 01
2
[LLVMdev] [llvm-commits] [PATCH] Allow per-thread re-direction of outs()/errs()
On Thu, May 31, 2012 at 8:06 PM, Chris Lattner <clattner at apple.com> wrote: > > On May 31, 2012, at 2:39 PM, Justin Holewinski wrote: > > > The attached patch add the ability to programmatically re-direct > outs()/errs() to an arbitrary raw_ostream instance, maintaining the > raw_ostream instances in a stack structure so clients can push/pop streams > at will. The
2011 May 18
1
[LLVMdev] get file name
Hi All, I am trying to get the name (hello) of the c file (e.g., hello.c) that I am processing. When I use Module.getModuleIdentifier, I get <stdin> as the module id. It seems I am doing something wrong. Any help is greatly appreciated. Thanks. George -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110518/f5b8bd14/attachment.html>
2006 Sep 25
2
[LLVMdev] Name of Function's original module during link-time optimization
...linked into the sole link-time Module (see patch). The reason I pass an extra argument to so many methods (I let it default to ""), is that I'd like to have a full path name, not only the specific file name, of the original modules. As such, using someFunction->getParent()->getModuleIdentifier() in lib/Linker/LinkModules.cpp:650 did not suffice. However, I noticed that File.toString() in lib/Linker/LinkItems.cpp:150 does not yield the full path name. Could this patch (in a revised form) be added to LLVM? Kind regards, Bram Adams GH-SEL, INTEC, Ghent University (Belgium) > Thi...
2010 Aug 17
4
[LLVMdev] clang: call extern function using JIT
hi, im creating a music application(image below). At the moment im using tcc compiler but im moving across to clang because of the improved compiler warnings. Can anyone please explain and show code so I can use clang's JIT to call functions in my application? Thanks. http://old.nabble.com/file/p29449300/51709341.jpeg -- View this message in context:
2012 Jun 01
3
[LLVMdev] [llvm-commits] [PATCH] Allow per-thread re-direction of outs()/errs()
...ng two modules of different data layouts!\n"; > if (!SrcM->getTargetTriple().empty() && > DstM->getTargetTriple() != SrcM->getTargetTriple()) { > errs() << "WARNING: Linking two modules of different target triples: "; > if (!SrcM->getModuleIdentifier().empty()) > errs() << SrcM->getModuleIdentifier() << ": "; > errs() << "'" << SrcM->getTargetTriple() << "' and '" > << DstM->getTargetTriple() << "'\n"; >...
2004 Oct 19
1
[LLVMdev] Re:question about Insert callInst to call a function in library
...rator gI=M->gbegin(),gE=M->gend();gI!=gE;++gI){ std::string GVname = gI->getName(); if(strcmp(GVname.c_str(),"Gvkey")==0){ randKey =(gI->getInitializer()); } } } void DecodeStr::DecodeString(Module *M){ std::cerr<<"filename "<<M->getModuleIdentifier()<<endl; for(Module::giterator gI = M->gbegin(),gE=M->gend();gI!=gE;++gI){ unsigned i=0; if(ConstantArray *Cstr = dyn_cast<ConstantArray>(gI->getInitializer())){ if(Cstr->getType()->getElementType()->isInteger()) { std::vector<Constant*> Hi...
2009 Nov 27
2
[LLVMdev] AsmPrinter question
...lename. In AsmPrinter::doInitialization() I found: if (MAI->hasSingleParameterDotFile()) { /* Very minimal debug info. It is ignored if we emit actual debug info. If we don't, this at least helps the user find where a function came from. */ O << "\t.file\t\"" << M.getModuleIdentifier() << "\"\n"; } Could someone explain what exactly this comment mean? Thanks in advance Artur -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20091127/20fb0baf/attachment.html>
2006 Sep 24
0
[LLVMdev] Name of Function's original module during link-time optimization
Hi Bram, On Sun, 2006-09-24 at 22:58 +0200, Bram Adams wrote: > Hi, > > During link-time optimization using llvm-ld, I occasionally need to > find the name/ID of the original module/bytecode file a Function > belonged to. In order to do this I added a nameOfPreviousModule- > attribute to Function and some getters/setters (see attached patch). > However, I can't
2006 Sep 25
0
[LLVMdev] Name of Function's original module during link-time optimization
...e link-time Module (see patch). The reason > I pass an extra argument to so many methods (I let it default to ""), is that > I'd like to have a full path name, not only the specific file name, of the > original modules. As such, using > someFunction->getParent()->getModuleIdentifier() in > lib/Linker/LinkModules.cpp:650 did not suffice. However, I noticed that > File.toString() in lib/Linker/LinkItems.cpp:150 does not yield the full path > name. > > Could this patch (in a revised form) be added to LLVM? What are you trying to accomplish? Why not use locatio...
2010 Aug 18
0
[LLVMdev] clang: call extern function using JIT
...--------- -- llvm::Function *EntryFn = Mod->getFunction("main"); if (!EntryFn) { llvm::errs() << "'main' function not found in module.\n"; return 255; } // FIXME: Support passing arguments. std::vector<std::string> Args; Args.push_back(Mod->getModuleIdentifier()); return EE->runFunctionAsMain(EntryFn, Args, envp); } // here the C code to be ran with JIT ------------------------------------------------------------------- int main() { int dd = yipee(1); return 1; } -----------------------------------------------------------------------------...
2006 Sep 24
2
[LLVMdev] Name of Function's original module during link-time optimization
Hi, During link-time optimization using llvm-ld, I occasionally need to find the name/ID of the original module/bytecode file a Function belonged to. In order to do this I added a nameOfPreviousModule- attribute to Function and some getters/setters (see attached patch). However, I can't find out how to read in the ModuleID of a Module during bytecode loading in
2010 Aug 18
1
[LLVMdev] clang: call extern function using JIT
...------------- llvm::Function *EntryFn = Mod->getFunction("main"); if (!EntryFn) { llvm::errs() << "'main' function not found in module.\n"; return 255; } // FIXME: Support passing arguments. std::vector<std::string> Args; Args.push_back(Mod->getModuleIdentifier()); return EE->runFunctionAsMain(EntryFn, Args, envp); } // here the C code to be ran with JIT ------------------------------------------------------------------- int main() { int dd = yipee(1); return 1; } Heres another screenshot of my music application, im very happy with the resul...