comparison ir/irclass.cpp @ 1533:d1652c8fb4f6

Get rid of USE_METADATA
author Benjamin Kramer <benny.kra@gmail.com>
date Sat, 11 Jul 2009 14:19:21 +0200
parents ad7f2f1862d6
children 7fcb72d518f6
comparison
equal deleted inserted replaced
1532:c88b16d4a13c 1533:d1652c8fb4f6
69 69
70 // classinfos cannot be constants since they're used a locks for synchronized 70 // classinfos cannot be constants since they're used a locks for synchronized
71 classInfo = new llvm::GlobalVariable( 71 classInfo = new llvm::GlobalVariable(
72 *gIR->module, tc->getPA().get(), false, _linkage, NULL, initname); 72 *gIR->module, tc->getPA().get(), false, _linkage, NULL, initname);
73 73
74 #ifdef USE_METADATA
75 // Generate some metadata on this ClassInfo if it's for a class. 74 // Generate some metadata on this ClassInfo if it's for a class.
76
77 ClassDeclaration* classdecl = aggrdecl->isClassDeclaration(); 75 ClassDeclaration* classdecl = aggrdecl->isClassDeclaration();
78 if (classdecl && !aggrdecl->isInterfaceDeclaration()) { 76 if (classdecl && !aggrdecl->isInterfaceDeclaration()) {
79 // Gather information 77 // Gather information
80 const LLType* type = DtoType(aggrdecl->type); 78 const LLType* type = DtoType(aggrdecl->type);
81 const LLType* bodyType = llvm::cast<LLPointerType>(type)->getElementType(); 79 const LLType* bodyType = llvm::cast<LLPointerType>(type)->getElementType();
90 llvm::MDNode* metadata = llvm::MDNode::get(mdVals, CD_NumFields); 88 llvm::MDNode* metadata = llvm::MDNode::get(mdVals, CD_NumFields);
91 // Insert it into the module 89 // Insert it into the module
92 new llvm::GlobalVariable(*gIR->module, metadata->getType(), true, 90 new llvm::GlobalVariable(*gIR->module, metadata->getType(), true,
93 METADATA_LINKAGE_TYPE, metadata, CD_PREFIX + initname); 91 METADATA_LINKAGE_TYPE, metadata, CD_PREFIX + initname);
94 } 92 }
95 #endif
96 93
97 return classInfo; 94 return classInfo;
98 } 95 }
99 96
100 ////////////////////////////////////////////////////////////////////////////// 97 //////////////////////////////////////////////////////////////////////////////