[LLVMdev] LLVM Win32 Issue

Aaron Dwyer llvmification at gmail.com
Wed Feb 20 19:16:19 PST 2008


Thanks for your response Chuck.

>From this and the other responses to my question, it looks like I'm
including all the right object files, so it must be something with
Visual Studio stripping "dead" code.

So, given your response Chuck, I have a few questions.

First, what exactly is the code that VStudio seems to be stripping?  I
might be able to figure out how to prevent it from being overzealous.

Second, I tried putting the code you gave in my app, and I got into a
wild goose chase of include files not being found.  Finally ended
with:

<myabsolutepathroot>\llvm\target\x86\x86instrinfo.h(225) : error
C2504: 'TargetInstrInfoImpl' : base class undefined

   Did you put that code into LLVM itself and then call it from your app?

Lastly, what do you mean by "somewhere real"?

Thanks again,

Aaron


> You'll need to link in x86.lib as generated from the VStudio project.
>
> I had trouble convincing VStudio's linker to keep the relevant code
> around, so did this in the app I work on:
>
> void
> LLVMCompiledProgram::linkerTrick()
> {
>     llvm::Module staticModule("staticModule");
>     std::string staticString;
>     llvm::X86_32TargetMachine staticMachine(staticModule, staticString);
> }
>
> Which I called from somewhere real.
>
> Chuck.



More information about the llvm-dev mailing list