new interface for 'DIBuilder::insertDeclare' and 'DIBuilder::createGlobalVariable' in LLVM 3.6 (ids: 076fd5dfc1f0600183bbc7db974dc7b39086136d and bc88cfc3512326d6c8f8dbf3c15d880c0e21feb0 correspondingly

This commit is contained in:
Anton Mitrokhin
2014-10-02 15:35:19 +04:00
parent df38b862c2
commit 57fb2a75ec
3 changed files with 45 additions and 0 deletions

View File

@@ -835,12 +835,23 @@ lDefineConstantInt(const char *name, int val, llvm::Module *module,
// have the DW_AT_artifical attribute. It's not clear if this
// matters for anything though.
llvm::DIGlobalVariable var =
#if !defined(LLVM_3_2) && !defined(LLVM_3_3) && !defined(LLVM_3_4) && !defined(LLVM_3_5)// LLVM 3.6+
m->diBuilder->createGlobalVariable(file,
name,
name,
file,
0 /* line */,
diType,
true /* static */,
sym->storagePtr);
#else
m->diBuilder->createGlobalVariable(name,
file,
0 /* line */,
diType,
true /* static */,
sym->storagePtr);
#endif
Assert(var.Verify());
}
}
@@ -895,12 +906,23 @@ lDefineProgramIndex(llvm::Module *module, SymbolTable *symbolTable) {
llvm::DIType diType = sym->type->GetDIType(file);
Assert(diType.Verify());
llvm::DIGlobalVariable var =
#if !defined(LLVM_3_2) && !defined(LLVM_3_3) && !defined(LLVM_3_4) && !defined(LLVM_3_5)// LLVM 3.6+
m->diBuilder->createGlobalVariable(file,
sym->name.c_str(),
sym->name.c_str(),
file,
0 /* line */,
diType,
false /* static */,
sym->storagePtr);
#else
m->diBuilder->createGlobalVariable(sym->name.c_str(),
file,
0 /* line */,
diType,
false /* static */,
sym->storagePtr);
#endif
Assert(var.Verify());
}
}