search for: write_escap

Displaying 20 results from an estimated 28 matches for "write_escap".

Did you mean: write_escaped
2018 Mar 09
0
Externally loadable Alias Analysis pass
...the output from pass (i.e. list of function names) Part of the source ode of the Hello pass: struct Hello : public FunctionPass { static char ID; // Pass identification, replacement for typeid Hello() : FunctionPass(ID) {} bool runOnFunction(Function &F) override { errs().write_escaped(F.getName()) << '\n'; return false; } }; } 2018-03-09 14:44 GMT+01:00 Dávid Bolvanský <david.bolvansky at gmail.com>: > I am currectly experimenting with -Xclang option.. I have a simple pass > (to just print function names). > > I ran: clang -Xclang...
2010 Aug 14
0
[LLVMdev] Questions about trip count
...for (; BB != E; ++BB) { const Loop* L = LI->getLoopFor(&*BB); if (L != NULL) { errs() << "Trip count: " << *SE->getBackedgeTakenCount(L); L->dump(); } } } virtual bool runOnFunction(Function &F) { HelloCounter++; errs() << "Hello: "; errs().write_escaped(F.getName()) << '\n'; getLoopInfo(F); return false; } // We don't modify the program, so we preserve all analyses virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); AU.addRequired<LoopInfo> (); AU.addRequired<ScalarEvolution> (); } };...
2012 Feb 15
2
[LLVMdev] Wrong AliasAnalysis::getModRefInfo result
...) a[i] = i; foo(a,b); return 0; } Obviously, for "foo", it only reads from array "a" and only writes to array "b". The LLVM pass: virtual bool runOnFunction(Function &F) { ++HelloCounter; errs() << "Hello: "; errs().write_escaped(F.getName()) << '\n'; AliasAnalysis &AA = getAnalysis<AliasAnalysis>(); for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I) { Instruction *Inst = &*I; if ( CallInst *ci = dyn_cast<CallInst>(Inst) ){ ci->du...
2010 Aug 12
2
[LLVMdev] Questions about trip count
On 08/12/2010 09:41 PM, Douglas do Couto Teixeira wrote: > Dear guys, > > I am having problems to obtain good information from the LoopInfo. > I am always getting a trip count of 0, even though I am clearly passing > a loop with a constant bound. I am using this pass below: Hi, I would propose to first check if the trip count is calculated correctly. I would do this with opt
2017 Apr 15
2
Why does an LLVM pass based on FunctionPass not get triggered for certain functions?
...vm/Support/raw_ostream.h" using namespace llvm; namespace { struct Hello : public FunctionPass { static char ID; Hello() : FunctionPass(ID) {} bool runOnFunction(Function &F) override { errs() << "Hello: "; errs().write_escaped(F.getName()) << '\n'; return false; } }; } char Hello::ID = 0;9 static RegisterPass<Hello> X("hello", "Hello World Pass", false, false); The sample program `world.c` looks like: #include <stdio.h> int ma...
2018 Mar 08
2
Externally loadable Alias Analysis pass
Hello, I am currently working with the implementation of CFL Andersen algorithmand I am trying to do some improvements to the Andersen algorithm. I would like to create loadable module .so and run clang with my e.g. "cfl-anders-improved.so" to avoid the "long" way - generating IR, running opt with my improved algorithm to generate optimalized code and then building it. Is a
2012 Feb 16
0
[LLVMdev] Wrong AliasAnalysis::getModRefInfo result
...liasAnalysis::alias on each pair of GEPs. Here is the code: AliasAnalysis &AA = getAnalysis<AliasAnalysis>(); TargetData &TD = getAnalysis<TargetData>(); for (Module::iterator it = M.begin(); it != M.end(); it++){ Function &F = *it; errs().write_escaped(F.getName()) << '\n'; for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I) { Instruction *Inst = &*I; if ( GetElementPtrInst *gep = dyn_cast<GetElementPtrInst>(Inst) ) geps.push_back(gep); } } errs...
2012 Apr 09
3
[LLVMdev] How to instrument a this function using insertBefore instruction???
...Pass { static char ID; Hello() : FunctionPass(ID) {} virtual bool runOnFunction(Function &F) { errs() << "Hello: "; errs().write_escaped(F.getName()) <<'\n'; // run through all the instruction and convert all the callinst to ... for (Function::iterator BI = F.begin(), BE = F.end(); BI != BE; ++BI) {...
2012 Apr 09
2
[LLVMdev] How to instrument a this function using insertBefore instruction???
...static char ID; > Hello() : FunctionPass(ID) {} > virtual bool runOnFunction(Function &F) > { > errs() << "Hello: "; > errs().write_escaped(F.getName()) > <<'\n'; > // run through all the instruction and convert all the callinst to ... > for (Function::iterator BI = F.begin(), BE = > F.end(); BI != BE; ++BI) > { >...
2012 Apr 09
0
[LLVMdev] How to instrument a this function using insertBefore instruction???
...Pass { static char ID; Hello() : FunctionPass(ID) {} virtual bool runOnFunction(Function &F) { errs() << "Hello: "; errs().write_escaped(F.getName()) <<'\n'; // run through all the instruction and convert all the callinst to ... for (Function::iterator BI = F.begin(), BE = F.end(); BI != BE; ++BI) {...
2012 Feb 16
0
[LLVMdev] Unable to load a new pass: opt -load=plugin.so not working?
...nction.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; namespace { struct Hello : public FunctionPass { static char ID; Hello() : FunctionPass(ID) {} virtual bool runOnFunction(Function &F) { errs() << "Hello: "; errs().write_escaped(F.getName()) << '\n'; return false; } }; } char Hello::ID = 0; static RegisterPass<Hello> X("hello", "Hello World Pass", false, false); Compile Steps: g++ -c pass.cpp -I/usr/local/include `llvm-config --cxxflags` g++ -shared -o pass.so pass.o...
2012 Apr 09
0
[LLVMdev] How to instrument a this function using insertBefore instruction???
...Pass { static char ID; Hello() : FunctionPass(ID) {} virtual bool runOnFunction(Function &F) { errs() << "Hello: "; errs().write_escaped(F.getName()) <<'\n'; // run through all the instruction and convert all the callinst to ... for (Function::iterator BI = F.begin(), BE = F.end(); BI != BE; ++BI) {...
2012 Apr 09
1
[LLVMdev] How to instrument a this function using insertBefore instruction???
...ID; >> Hello() : FunctionPass(ID) {} >> virtual bool runOnFunction(Function &F) >> { >> errs() << "Hello: "; >> errs().write_escaped(F.getName()) >> <<'\n'; >> // run through all the instruction and convert all the callinst to ... >> for (Function::iterator BI = F.begin(), BE = >> F.end(); BI != BE; ++BI) >> { >>...
2013 Feb 16
1
[LLVMdev] A weird problem when try to output operand of instruction involving function pointer in a struct
...nction calls: for (Function::iterator b = F.begin(), be = F.end(); b != be; ++b) { for (BasicBlock::iterator i = b->begin(), ie = b->end(); i != ie; ++i) { if (CallInst* callInst = dyn_cast<CallInst>(&*i)) { Function *fun = callInst->getCalledFunction(); if(fun){ errs().write_escaped(fun->getName()); } else{ errs() <<"indirect call: "; Instruction* pinst = &*i; for(User::op_iterator opi=pinst->op_begin(), opie=pinst->op_end(); opi!=opie; ++opi){ if (Instruction *Op = dyn_cast<Instruction>(*opi)){ errs() <<Op->getOperan...
2019 Apr 18
3
Opt plugin linkage
...Str(&errStr); eb.setEngineKind(EngineKind::Kind::JIT); ExecutionEngine* ee=eb.create(); errs()<<"ExecutionEngine:"<<ee<<" Error:"<<errStr<<"\n"; delete ee; errs() << "Hello: "; errs().write_escaped(F.getName()) << '\n'; return false; } ``` Modified opt's CMakeLists.txt: ``` set(LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD} AggressiveInstCombine Analysis BitWriter CodeGen Core MC MCJIT Object OrcJIT Interpreter RuntimeDyld Coroutines...
2019 Apr 16
2
Opt plugin linkage
Hey: I spent sometime debugging this, it seems like editing ``llvm/tools/opt.cpp`` and move ``cl::ParseCommandLineOptions(argc, argv, "llvm .bc -> .bc modular optimizer and analysis printer\n");`` to the beginning of main() solved it for me. I'm not sure if this is a bug on LLVM side Zhang ------------------ Original ------------------ From: "Viktor Was BSc via
2016 Mar 28
2
llvm extract struct elements and struct size in C++
...ructModulePass() : ModulePass(ID) {} virtual bool runOnModule(Module &M1) override { // iterate over global structures M = &M1; int i; for(auto G = M->global_begin(); G!= M->global_end() ; G++, i++){ errs() << i << " == > " ; errs().write_escaped(G->getName()) << "\n"; } // iterate through each instruction. module->function->BB->Inst for(auto &F_ : M->functions()){ F = &F_; for(auto &B_ : *F) B = &B_; for(auto &I : *B) { for (unsigned i = 0; i < I.getNu...
2012 Apr 10
0
[LLVMdev] How to get the module handle of a .bc file??
Objects that form the IR (functions, basic blocks, instructions) have the getParent() method that returns their paren (module for a function, basic block for a single instruction etc.) BTW, LLVM Doxygen is really helpful. It's usually the first result when you search for "LLVM <classname> class reference" On Tue, Apr 10, 2012 at 11:17 AM, 15102925731 <zhenkaixd at
2012 Oct 23
0
[LLVMdev] Error building llvm on AIX 7.1
...RROR: Undefined symbol: .llvm::Statistic::RegisterStatistic() ld: 0711-317 ERROR: Undefined symbol: .AnnotateHappensAfter ld: 0711-317 ERROR: Undefined symbol: .llvm::errs() ld: 0711-317 ERROR: Undefined symbol: .llvm::Value::getName() const ld: 0711-317 ERROR: Undefined symbol: .llvm::raw_ostream::write_escaped(llvm::StringRef, bool) ld: 0711-317 ERROR: Undefined symbol: .llvm::raw_ostream::write(char const*, unsigned long) ld: 0711-317 ERROR: Undefined symbol: .llvm::raw_ostream::write(unsigned char) ld: 0711-317 ERROR: Undefined symbol: .llvm::PassRegistry::getPassRegistry() ld: 0711-317 ERROR: Undefi...
2012 Apr 10
2
[LLVMdev] How to get the module handle of a .bc file??
Hi all, I want to run a function pass on a certain .bc file. In the process, the pass will insert a check function into the .bc file. I know the .bc file is regarded as a module in LLVM. So, there are two basic steps needed to be done, 1, Use the "getOrInsertFunction"API to add a declaration of the extern "check function". 2, Use the "insertBefore"API to insert the