[cfe-dev] Analysis and code generation actions

Anton Lokhmotov Anton.Lokhmotov at arm.com
Thu Feb 18 02:13:07 PST 2010


Hi Doug,

Thanks a lot for reassuring me that I’m on the right way!  I’m just so
bamboozled by not being able to run even a minimal program.  Perhaps I need
to file a bug report for this.

(Again, using gcc 3.4.6 on RHEL4 to compile with r96575

#include <clang/Frontend/FrontendActions.h>
int main() { clang::EmitLLVMOnlyAction emitLLVM; }

results in:
 
lib/VMCore/Pass.cpp:228: void <unnamed>::PassRegistrar::RegisterPass(const
llvm::PassInfo&): Assertion `Inserted && "Pass registered multiple times!"'
failed.)

> When you're emitting LLVM IR, you naturally end up using LLVM's
optimization infrastructure to handle that IR, so you need to link in that
code.

Yes, some of it.  But generating LLVM code with clang::CreateLLVMCodeGen
does no optimisations, and hence requires a minimal set of LLVM libraries,
so I thought I'd get the same or similar behaviour when using
clang::EmitLLVMOnlyAction...

Many thanks again,
Anton.






More information about the cfe-dev mailing list