mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-05-02 00:11:30 +02:00
[svn r267] Fixed debug info for global variables.
Cleaned up the debug info code in general.
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#include "gen/classes.h"
|
||||
#include "gen/functions.h"
|
||||
#include "gen/typeinf.h"
|
||||
#include "gen/todebug.h"
|
||||
|
||||
/****************************************************************************************/
|
||||
/*////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -810,6 +811,13 @@ void DtoConstInitGlobal(VarDeclaration* vd)
|
||||
if (!(vd->storage_class & STCextern) && (vd->getModule() == gIR->dmodule || istempl))
|
||||
{
|
||||
gvar->setInitializer(_init);
|
||||
// do debug info
|
||||
if (global.params.symdebug)
|
||||
{
|
||||
LLGlobalVariable* gv = DtoDwarfGlobalVariable(gvar, vd);
|
||||
// keep a reference so GDCE doesn't delete it !
|
||||
gIR->usedArray.push_back(llvm::ConstantExpr::getBitCast(gv, getVoidPtrType()));
|
||||
}
|
||||
}
|
||||
|
||||
if (emitRTstaticInit)
|
||||
|
||||
Reference in New Issue
Block a user