[LLVMdev] How to get llvm bitcode executed

Xiaolong Tang xiaolong.snake at gmail.com
Tue May 22 12:21:17 PDT 2012


Hi All, 

I have a program that uses C++ STL a lot. To have the source code for
STL functions, I undefined "_GLIBCXX_EXTERN_TEMPLATE" in
c++config.h. In spite of this, after compilation (via clang) and
linking (via llvm-ld), the resulting bitcode contains a few declared
functions (with no definitions).

My question is: In the scenario where some function definitions are
missing in a llvm bitcode, can we get a way to run this module via llc
or lli? Or is there any way to make these function definitions
available in the llvm bitcode? 

Specifically, these missing functions are as below: 

  declare i8* @llvm.eh.exception() nounwind readonly
  declare i32 @__gxx_personality_v0(...)
  declare i32 @llvm.eh.selector(i8*, i8*, ...) nounwind
  declare void @llvm.eh.resume(i8*, i32)
  declare void @_ZSt9terminatev()
  declare i32 @memcmp(i8*, i8*, i64)
  declare i64 @llvm.expect.i64(i64, i64) nounwind readnone
  declare void @_ZSt19__throw_logic_errorPKc(i8*) noreturn
  declare i8* @__cxa_begin_catch(i8*)
  declare void @__cxa_rethrow()
  declare void @__cxa_end_catch()
  declare void @__cxa_call_unexpected(i8*)
  declare void @_ZdlPv(i8*) nounwind
  declare void @_ZSt20__throw_length_errorPKc(i8*) noreturn
  declare void @_ZSt17__throw_bad_allocv() noreturn
  declare noalias i8* @_Znwm(i64)
  declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
  declare void @llvm.memmove.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
  declare i32 @llvm.atomic.load.add.i32.p0i32(i32* nocapture, i32) nounwind
  declare void @llvm.memory.barrier(i1, i1, i1, i1, i1) nounwind
  declare void @_ZSt20__throw_out_of_rangePKc(i8*) noreturn
  declare i64 @strlen(i8*)
  declare void @abort()


Xiaolong



More information about the llvm-dev mailing list