Hello . I would like to add new custom data type to llvm C parser, I use LLVM/Clang version 3.1. Adding new type instructions from llvm.org site are out of date (http://llvm.org/docs/ExtendingLLVM.html#type). Could you please provide me with guidance? Thanks in advance, Edvard -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120713/a4cd12db/attachment.html>
>>>>> Edvard Ghazaryan <edvard_gh at yahoo.com> writes:> I would like to add new custom data type to llvm C parser, I use LLVM/Clang > version 3.1. > Adding new type instructions from llvm.org site are out of date (http:// > llvm.org/docs/ExtendingLLVM.html#type). > Could you please provide me with guidance?Check out include/clang/AST/Type.h in the clang sources. Pick an existing type with similar semantics to what you want to add (pointer type, scalar type, etc), and then derive a new class either from Type, or from the type you want to specialize. -- John Wiegley BoostPro Computing http://www.boostpro.com
Hello . I'm trying to implement LoopPass. Here is simple code : class LoopParser: public llvm::LoopPass { public: static char ID; public: virtual void getAnalysisUsage(llvm::AnalysisUsage &AU) const { AU.addRequiredID(llvm::LoopSimplifyID); AU.addPreservedID(llvm::LoopSimplifyID); AU.addRequired<llvm::LoopInfo>(); } virtual bool runOnLoop(llvm::Loop* IncomingLoop, llvm::LPPassManager& LPM_Ref) { return false; } LoopParser() : llvmLoopPass(ID) {} }; char LoopParser::ID = 0; static llvm::RegisterPass<LoopParser> XX("LoopParser", "TODO ", false, false); when I'am trying to load a get the error message : undefined symbol: _ZTIN4llvm8LoopPassE How can I fix? Thanks in advance, Edvard -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120722/d3f19e4c/attachment.html>
Hi Edvard, _ZTIN4llvm8LoopPassE is "typeinfo for llvm::LoopPass". LLVM is built without typeinfo, so you will need to build your pass with -fno-rtti. Ciao, Duncan.> I'm trying to implement LoopPass. > Here is simple code : > > class LoopParser: public llvm::LoopPass > { > public: > static char ID; > > public: > virtual void getAnalysisUsage(llvm::AnalysisUsage &AU) const > { > AU.addRequiredID(llvm::LoopSimplifyID); > AU.addPreservedID(llvm::LoopSimplifyID); > AU.addRequired<llvm::LoopInfo>(); > } > > virtual bool runOnLoop(llvm::Loop* IncomingLoop, > llvm::LPPassManager& LPM_Ref) > { return false; } > > LoopParser() : llvmLoopPass(ID) > {} > }; > char LoopParser::ID = 0; > static llvm::RegisterPass<LoopParser> XX("LoopParser", "TODO ", false, false); > > when I'am trying to load a get the error message : undefined symbol: > _ZTIN4llvm8LoopPassE > How can I fix? > > Thanks in advance, > Edvard > > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
Hello . I'm trying to implement FunctionPass for detecting loops in llvm IR. How can I get <condition> for loop from llvm::Loop object.? Is there any example? Thanks in advance, Edvard -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120723/85e7f2f9/attachment.html>