Revision: 3404 http://trac.macosforge.org/projects/ruby/changeset/3404 Author: lsansonetti@apple.com Date: 2010-02-01 17:35:46 -0800 (Mon, 01 Feb 2010) Log Message: ----------- follow LLVM ToT Modified Paths: -------------- MacRuby/trunk/compiler.cpp MacRuby/trunk/compiler.h MacRuby/trunk/vm.cpp Modified: MacRuby/trunk/compiler.cpp =================================================================== --- MacRuby/trunk/compiler.cpp 2010-02-02 01:35:45 UTC (rev 3403) +++ MacRuby/trunk/compiler.cpp 2010-02-02 01:35:46 UTC (rev 3404) @@ -12,6 +12,10 @@ # define DW_LANG_Ruby 0x15 // TODO: Python is 0x14, request a real number #endif +#if LLVM_TOT +# include <llvm/LLVMContext.h> +#endif + #include "llvm.h" #include "ruby/ruby.h" #include "ruby/encoding.h" @@ -182,6 +186,14 @@ #if ROXOR_COMPILER_DEBUG level = 0; #endif + +#if LLVM_TOT + dbg_mdkind = context.getMetadata().getMDKind("dbg"); + if (dbg_mdkind == 0) { + dbg_mdkind = context.getMetadata().registerMDKind("dbg"); + } + assert(dbg_mdkind != 0); +#endif } RoxorAOTCompiler::RoxorAOTCompiler(void) @@ -752,7 +764,13 @@ Instruction *insn = compile_protected_call(dispatcherFunc, params); if (fname != NULL) { +#if LLVM_TOT + DILocation loc = debug_info->CreateLocation(current_line, 0, + debug_compile_unit, DILocation(NULL)); + context.getMetadata().addMD(dbg_mdkind, loc.getNode(), insn); +#else debug_info->InsertStopPoint(debug_compile_unit, current_line, 0, bb); +#endif } return insn; } Modified: MacRuby/trunk/compiler.h =================================================================== --- MacRuby/trunk/compiler.h 2010-02-02 01:35:45 UTC (rev 3403) +++ MacRuby/trunk/compiler.h 2010-02-02 01:35:46 UTC (rev 3404) @@ -222,6 +222,10 @@ const Type *IntTy; const PointerType *Int32PtrTy; +#if LLVM_TOT + unsigned dbg_mdkind; +#endif + void compile_node_error(const char *msg, NODE *node); virtual Constant * Modified: MacRuby/trunk/vm.cpp =================================================================== --- MacRuby/trunk/vm.cpp 2010-02-02 01:35:45 UTC (rev 3403) +++ MacRuby/trunk/vm.cpp 2010-02-02 01:35:46 UTC (rev 3404) @@ -176,6 +176,8 @@ return mm->getGOTBase(); } +#if LLVM_TOT +#else void SetDlsymTable(void *ptr) { mm->SetDlsymTable(ptr); } @@ -183,6 +185,7 @@ void *getDlsymTable() const { return mm->getDlsymTable(); } +#endif uint8_t *startFunctionBody(const Function *F, uintptr_t &ActualSize) {