search for: ctorfn

Displaying 12 results from an estimated 12 matches for "ctorfn".

Did you mean: ctor
2009 Mar 08
2
[LLVMdev] addPassesToEmitFile
...d code to a string, so I could use it to read it on the screen. I came up with this solution: std::string Err; const llvm::TargetMachineRegistry::entry* _arch = llvm::TargetMachineRegistry::getClosestTargetForJIT(Err); std::string FeaturesStr; llvm::TargetMachine* target(_arch->CtorFn(*_module, FeaturesStr)); assert(target && "Could not allocate target machine!"); std::ostringstream os; target->addPassesToEmitFile(*_passManager, os, llvm::TargetMachine::AssemblyFile, true); target->addPassesToEmitFileFinish(*_passManager, 0, true); Ho...
2009 Mar 08
0
[LLVMdev] addPassesToEmitFile
...> it to read it on the screen. I came up with this solution: > >    std::string Err; >    const llvm::TargetMachineRegistry::entry* _arch = > llvm::TargetMachineRegistry::getClosestTargetForJIT(Err); > >    std::string FeaturesStr; >    llvm::TargetMachine* target(_arch->CtorFn(*_module, FeaturesStr)); >    assert(target && "Could not allocate target machine!"); > >    std::ostringstream os; > >    target->addPassesToEmitFile(*_passManager, os, > llvm::TargetMachine::AssemblyFile, true); >    target->addPassesToEmitFileFinish(*...
2009 Mar 09
1
[LLVMdev] addPassesToEmitFile
...e screen. I came up with this solution: > > >    std::string Err; > >    const llvm::TargetMachineRegistry::entry* _arch = > > llvm::TargetMachineRegistry::getClosestTargetForJIT(Err); > > >    std::string FeaturesStr; > >    llvm::TargetMachine* target(_arch->CtorFn(*_module, FeaturesStr)); > >    assert(target && "Could not allocate target machine!"); > > >    std::ostringstream os; > > >    target->addPassesToEmitFile(*_passManager, os, > > llvm::TargetMachine::AssemblyFile, true); > >    target->ad...
2008 May 28
1
[LLVMdev] Asm output while executing
...use: /// The asm code output std::string Err; const llvm::TargetMachineRegistry::entry* MArch = llvm::TargetMachineRegistry::getClosestStaticTargetForModule(*_module,Err); std::string FeaturesStr; std::auto_ptr<llvm::TargetMachine>target(MArch->CtorFn(*_module,FeaturesStr)); assert(target.get() && "Could not allocate target machine!"); llvm::TargetMachine &Target = *target.get(); llvm::FunctionPassManager Passes(new llvm::ExistingModuleProvider(_module)); Passes.add(new llvm::TargetData(*Target.getT...
2007 Jan 22
2
[LLVMdev] addPassesToEmit(Whole)File changes?
...oFile:(NSString*)filename { TargetMachine::CodeGenFileType FileType = TargetMachine::AssemblyFile; std::string err1; Module *M=(Module*)module; const TargetMachineRegistry::Entry* entry= TargetMachineRegistry::getClosestStaticTargetForModule( *M, err1 ); TargetMachine &target=*entry->CtorFn( *M, "" ); [self generateMethodLists]; std::ostream *outStream = 0; PassManager passes; outStream = new std::ofstream( [filename fileSystemRepresentation] ); TargetData *data =new TargetData( *target.getTargetData()); passes.add(data); target.addPassesToEmitFile(passes, *outStream,...
2007 Aug 31
3
[LLVMdev] PATCH: Registry template
...signature: + /// + /// entry(const char *Name, const char *ShortDesc, T * (*Ctor)()); + /// + /// If you have more elaborate requirements, then copy and modify. + /// + template <typename V> + class Add { + entry Entry; + node Node; + + static T *CtorFn() { return new V(); } + + public: + Add(const char *Name, const char *Desc) + : Entry(Name, Desc, CtorFn), Node(Entry) {} + }; + + + /// A command-line parser for a registry. Use like such: + /// + /// static cl::opt<Registry<TargetCollector>::entry, + ///...
2009 Mar 17
0
[LLVMdev] Printing x86 ASM for Function
Dear Maxime, Nyx wrote: > Hello, > > I would like to know how to go about printing the x86 assembly output for a > compiled function (I'm using the JIT). I saw there is a X86IntelAsmPrinter > on doxygen. However, it takes several arguments I don't know how to fill in. > Is there a helper function to create such a pass? Once I have the pass > created, do I just add it
2007 Jan 22
0
[LLVMdev] addPassesToEmit(Whole)File changes?
...oFile:(NSString*)filename { TargetMachine::CodeGenFileType FileType = TargetMachine::AssemblyFile; std::string err1; Module *M=(Module*)module; const TargetMachineRegistry::Entry* entry= TargetMachineRegistry::getClosestStaticTargetForModule( *M, err1 ); TargetMachine &target=*entry->CtorFn( *M, "" ); [self generateMethodLists]; std::ostream *outStream = 0; PassManager passes; outStream = new std::ofstream( [filename fileSystemRepresentation] ); TargetData *data =new TargetData( *target.getTargetData()); passes.add(data); target.addPassesToEmitFile(passes, *outStream,...
2007 Nov 08
3
[LLVMdev] Newbie JITter
...istry::entry* MArch = TargetMachineRegistry::getClosestStaticTargetForModule(*M, MArchErr); if (MArch == 0) { std::cerr << "error auto-selecting target for module '" << MArchErr << "'.\n"; return 1; } TargetMachine* target = MArch->CtorFn(*M, ""); assert(target && "Could not allocate target machine!"); FunctionPassManager Passes(new ExistingModuleProvider(M)); Passes.add(new TargetData(*target->getTargetData())); Passes.add(createVerifierPass()); switch (target->addPassesToEmitFil...
2009 Mar 16
2
[LLVMdev] Printing x86 ASM for Function
Hello, I would like to know how to go about printing the x86 assembly output for a compiled function (I'm using the JIT). I saw there is a X86IntelAsmPrinter on doxygen. However, it takes several arguments I don't know how to fill in. Is there a helper function to create such a pass? Once I have the pass created, do I just add it to a FunctionPassManager? Thank you for your time, -
2007 Jan 22
0
[LLVMdev] addPassesToEmit(Whole)File changes?
...> TargetMachine::CodeGenFileType FileType = TargetMachine::AssemblyFile; > std::string err1; > Module *M=(Module*)module; > const TargetMachineRegistry::Entry* entry= > TargetMachineRegistry::getClosestStaticTargetForModule( *M, err1 ); > TargetMachine &target=*entry->CtorFn( *M, "" ); > [self generateMethodLists]; > std::ostream *outStream = 0; > PassManager passes; > outStream = new std::ofstream( [filename fileSystemRepresentation] ); > TargetData *data =new TargetData( *target.getTargetData()); > passes.add(data); > target.addP...
2007 Nov 09
0
[LLVMdev] Newbie JITter
...hineRegistry::getClosestStaticTargetForModule(*M, MArchErr); > if (MArch == 0) { > std::cerr << "error auto-selecting target for module '" << > MArchErr << "'.\n"; > return 1; > } > > TargetMachine* target = MArch->CtorFn(*M, ""); > assert(target && "Could not allocate target machine!"); > > FunctionPassManager Passes(new ExistingModuleProvider(M)); > Passes.add(new TargetData(*target->getTargetData())); > > Passes.add(createVerifierPass()); > >...