comparison gen/todebug.cpp @ 1322:b8c2f3e05b52

Fixed compile unit for debug info for array operations, fixed ticket #280 .
author Tomas Lindquist Olsen <tomas.l.olsen gmail com>
date Sat, 09 May 2009 15:27:27 +0200
parents 0686701178d3
children 5a54b39af6d6
comparison
equal deleted inserted replaced
1321:d55945bcb02d 1322:b8c2f3e05b52
93 ////////////////////////////////////////////////////////////////////////////////////////////////// 93 //////////////////////////////////////////////////////////////////////////////////////////////////
94 94
95 // get the module the symbol is in, or - for template instances - the current module 95 // get the module the symbol is in, or - for template instances - the current module
96 static Module* getDefinedModule(Dsymbol* s) 96 static Module* getDefinedModule(Dsymbol* s)
97 { 97 {
98 if (!DtoIsTemplateInstance(s)) 98 // templates are defined in current module
99 return s->getModule(); 99 if (DtoIsTemplateInstance(s))
100 else 100 {
101 return gIR->dmodule; 101 return gIR->dmodule;
102 }
103 // array operations as well
104 else if (FuncDeclaration* fd = s->isFuncDeclaration())
105 {
106 if (fd->isArrayOp)
107 return gIR->dmodule;
108 }
109 // otherwise use the symbol's module
110 return s->getModule();
102 } 111 }
103 112
104 ////////////////////////////////////////////////////////////////////////////////////////////////// 113 //////////////////////////////////////////////////////////////////////////////////////////////////
105 114
106 static llvm::DIType dwarfTypeDescription_impl(Type* type, llvm::DICompileUnit cu, const char* c_name); 115 static llvm::DIType dwarfTypeDescription_impl(Type* type, llvm::DICompileUnit cu, const char* c_name);