search for: targetmachineregistry

Displaying 20 results from an estimated 23 matches for "targetmachineregistry".

2009 Mar 08
2
[LLVMdev] addPassesToEmitFile
Hi, Long time ago (llvm-svn june 2008) I asked here about a way to output the assembly code of my JIT generated 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-&gt...
2009 Mar 08
0
[LLVMdev] addPassesToEmitFile
...gmail.com>: > Hi, > > > Long time ago (llvm-svn june 2008) I asked here about a way to output > the assembly code of my JIT generated 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::ostr...
2009 Mar 09
1
[LLVMdev] addPassesToEmitFile
...Hi, > > > Long time ago (llvm-svn june 2008) I asked here about a way to output > > the assembly code of my JIT generated 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!"); &g...
2008 May 28
1
[LLVMdev] Asm output while executing
...Function::construct(const llvm::Function*, const llvm::TargetMachine&): Assertion `Fn->getAnnotation(MF_AID) == 0 && "Object already exists for this function!"' failed. ********** The code I 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 m...
2007 Jan 22
2
[LLVMdev] addPassesToEmit(Whole)File changes?
...to get it to work with the newest llvm version at some point. Any pointers? Thanks! Marcel This is my current code: -(void)dumpAssemblerToFile:(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]...
2007 Nov 08
3
[LLVMdev] Newbie JITter
...ude "llvm/System/Signals.h" #include "llvm/ExecutionEngine/GenericValue.h" #include "llvm/PassManager.h" #include "llvm/CodeGen/Passes.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetMachineRegistry.h" #include <iostream> using namespace llvm; int main() { sys::PrintStackTraceOnErrorSignal(); const char* assembler = "@.LC0 = internal constant [19 x i8] c\"cooking with gas!\\0A\\00 \" ; [11 x i8]*\n" "\n" "declare i32 @puts(i8 *)...
2007 Aug 25
0
[LLVMdev] Some questions about building an LLVM frontend
...f them seem focused on generating either bitcode or JITs, which I'm not interested in - I want to get an executable containing natively compiled code. The one example that seems close to what I want is the llc.cpp source file; But when I try to do the same thing in my code, I find that the TargetMachineRegistry is empty; And yet I see no code in llc.cpp that initializes this, nor do I see #includes or Makefile dependencies in the llc project that would do this implicitly. Sincerely Puzzled, -- Talin Chris Lattner wrote: > On Aug 13, 2007, at 9:20 PM, Talin wrote: >> Hi, I spoke with you brie...
2008 Oct 07
2
[LLVMdev] Getting target machine specific information at run-time
...s solution, but I have problems accessing the architecture dependent bits of the Module, i.e. TargetMachine objects specific for the current architecture, as selected by the --march option of the compiler. I tried using the getClosestTargetForJIT and getClosestStaticTargetForModule functions of the TargetMachineRegistry class. But all that was without success. I always get back only X86-based targets (which is the target architecture of my development machine) even though I explicitly select another target for cross-compilation by doing --march=sparc or --march=alpha. Could someone explain, what is a correct wa...
2007 Aug 14
3
[LLVMdev] Some questions about building an LLVM frontend
On Aug 13, 2007, at 9:20 PM, Talin wrote: > Hi, I spoke with you briefly after your talk at Google; I've since > been playing around with LLVM quite a bit and started working on a > front end for my experimental programming language, Tart. Cool, welcome :) > A couple of questions I wanted to ask (although feel free to answer > by saying "go ask on the mailing
2007 Nov 09
0
[LLVMdev] Newbie JITter
...h" > #include "llvm/ExecutionEngine/GenericValue.h" > #include "llvm/PassManager.h" > #include "llvm/CodeGen/Passes.h" > #include "llvm/Target/TargetData.h" > #include "llvm/Target/TargetMachine.h" > #include "llvm/Target/TargetMachineRegistry.h" > #include <iostream> > using namespace llvm; > > int main() { > sys::PrintStackTraceOnErrorSignal(); > > const char* assembler = > "@.LC0 = internal constant [19 x i8] c\"cooking with gas!\\0A\\00 > \" ; [11 x i8]*\n" > "...
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?
...to get it to work with the newest llvm version at some point. Any pointers? Thanks! Marcel This is my current code: -(void)dumpAssemblerToFile:(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]...
2008 Jul 23
0
[LLVMdev] CollectorRegistry
...attribute of a function: define void @f() gc "mygc" { ... } This string must correspond to the first argument to the CollectorRegistry::Add<> constructor. The second argument to the constructor is, I think, "purely informational" for collectors. For the related TargetMachineRegistry, the second argument appears in --help output. Hope that helps, Gordon
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, -
2008 Jul 23
2
[LLVMdev] CollectorRegistry
Hey, I am a bit confused about the CollectorRegistry. I am attempting to write a garbage collector for LLVM, and the tiny example in the docs at http://llvm.org/releases/2.3/docs/GarbageCollection.html gives this line: CollectorRegistry::Add<MyCollector> X("mygc", "My bespoke garbage collector."); My question is now: Am I supposed to instantiate my collector
2007 Jan 22
0
[LLVMdev] addPassesToEmit(Whole)File changes?
...ion/doFinalization methods handle the global data. -Chris > This is my current code: > > -(void)dumpAssemblerToFile:(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( [filena...
2007 Aug 31
3
[LLVMdev] PATCH: Registry template
This is a template that takes care of managing plugin registries. I wrote it because I got the distinct feeling I was needlessly reinventing the wheel as I wrote a collector registry. I haven't converted anything else to use it, though. Still, it's orthogonal and has become stable in my usage, so I thought I'd submit it in advance. To get my collector registry going, all I
2008 Oct 08
1
[LLVMdev] Getting target machine specific information at run-time
...; accessing the architecture dependent bits of the Module, i.e. TargetMachine > > objects specific for the current architecture, as selected by the --march > > option of the compiler. I tried using the getClosestTargetForJIT and > > getClosestStaticTargetForModule functions of the TargetMachineRegistry > > class. But all that was without success. I always get back only X86-based > > targets (which is the target architecture of my development machine) even > > though I explicitly select another target for cross-compilation by doing > > --march=sparc or --march=alpha. >...
2008 Jul 23
3
[LLVMdev] CollectorRegistry
...ly ok to have to replace calls to malloc, though). > > This string must correspond to the first argument to the > CollectorRegistry::Add<> constructor. > > The second argument to the constructor is, I think, "purely > informational" for collectors. For the related TargetMachineRegistry, > the second argument appears in --help output. > > Hope that helps, > Gordon It helps a lot. Thank you for your time. :-) Simon
2008 Feb 21
0
[LLVMdev] LLVM Win32 Issue
Hola Aaron, Just having that code didn't work since the linker still stripped it out, so I have that function called from the code in the system that actually is being used by our app. Kinda grubby, but I include: #include "llvm/lib/Target/X86/X86TargetMachine.h" Which is in the LLVM lib, not the LLVM inc directory. This little maneuver made our Mac builds really unhappy, so