comparison gen/todebug.cpp @ 1064:f0b6549055ab

Make LDC work with LLVM trunk (s/LinkOnceLinkage/LinkOnceOdrLinkage/) Also moved the #defines for linkage types into a separate header instead of mars.h so we can #include revisions.h without having to rebuild the entire frontend every time we update. (I'm using revisions.h to get the LLVM revision for use in preprocessor conditionals. It should work with LLVM release 2.5, old trunk and new trunk)
author Frits van Bommel <fvbommel wxs.nl>
date Sun, 08 Mar 2009 16:13:10 +0100
parents ff22650d0ca3
children 7db4bb9602ed
comparison
equal deleted inserted replaced
1063:40d7f9b7357f 1064:f0b6549055ab
10 #include "gen/todebug.h" 10 #include "gen/todebug.h"
11 #include "gen/irstate.h" 11 #include "gen/irstate.h"
12 #include "gen/tollvm.h" 12 #include "gen/tollvm.h"
13 #include "gen/logger.h" 13 #include "gen/logger.h"
14 #include "gen/llvmhelpers.h" 14 #include "gen/llvmhelpers.h"
15 #include "gen/linkage.h"
15 16
16 #include "ir/irmodule.h" 17 #include "ir/irmodule.h"
17 18
18 using namespace llvm::dwarf; 19 using namespace llvm::dwarf;
19 20
31 * @param name Name. 32 * @param name Name.
32 * @return The global variable. 33 * @return The global variable.
33 */ 34 */
34 static LLGlobalVariable* emitDwarfGlobalDecl(const LLStructType* type, const char* name, bool linkonce=false) 35 static LLGlobalVariable* emitDwarfGlobalDecl(const LLStructType* type, const char* name, bool linkonce=false)
35 { 36 {
36 LLGlobalValue::LinkageTypes linkage = linkonce ? LLGlobalValue::LinkOnceLinkage : LLGlobalValue::InternalLinkage; 37 LLGlobalValue::LinkageTypes linkage = linkonce
38 ? DEBUGINFO_LINKONCE_LINKAGE_TYPE
39 : LLGlobalValue::InternalLinkage;
37 LLGlobalVariable* gv = new LLGlobalVariable(type, true, linkage, NULL, name, gIR->module); 40 LLGlobalVariable* gv = new LLGlobalVariable(type, true, linkage, NULL, name, gIR->module);
38 gv->setSection("llvm.metadata"); 41 gv->setSection("llvm.metadata");
39 return gv; 42 return gv;
40 } 43 }
41 44