Mercurial > projects > ldc
comparison ir/irclass.cpp @ 1558:3adcb70700cb
Added back option to disable metadata generation and users. Set USE_METADATA to OFF in ccmake.
author | Tomas Lindquist Olsen <tomas.l.olsen gmail com> |
---|---|
date | Fri, 31 Jul 2009 11:28:31 +0200 |
parents | ed0cffe895ec |
children | 8912aabdb26e |
comparison
equal
deleted
inserted
replaced
1557:d11aeae19b95 | 1558:3adcb70700cb |
---|---|
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 #if USE_METADATA | |
74 // Generate some metadata on this ClassInfo if it's for a class. | 75 // Generate some metadata on this ClassInfo if it's for a class. |
75 ClassDeclaration* classdecl = aggrdecl->isClassDeclaration(); | 76 ClassDeclaration* classdecl = aggrdecl->isClassDeclaration(); |
76 if (classdecl && !aggrdecl->isInterfaceDeclaration()) { | 77 if (classdecl && !aggrdecl->isInterfaceDeclaration()) { |
77 // Gather information | 78 // Gather information |
78 const LLType* type = DtoType(aggrdecl->type); | 79 const LLType* type = DtoType(aggrdecl->type); |
88 llvm::MetadataBase* metadata = gIR->context().getMDNode(mdVals, CD_NumFields); | 89 llvm::MetadataBase* metadata = gIR->context().getMDNode(mdVals, CD_NumFields); |
89 // Insert it into the module | 90 // Insert it into the module |
90 std::string metaname = CD_PREFIX + initname; | 91 std::string metaname = CD_PREFIX + initname; |
91 llvm::NamedMDNode::Create(metaname, &metadata, 1, gIR->module); | 92 llvm::NamedMDNode::Create(metaname, &metadata, 1, gIR->module); |
92 } | 93 } |
94 #endif // USE_METADATA | |
93 | 95 |
94 return classInfo; | 96 return classInfo; |
95 } | 97 } |
96 | 98 |
97 ////////////////////////////////////////////////////////////////////////////// | 99 ////////////////////////////////////////////////////////////////////////////// |