Merge pull request #906 from ncos/ispc_build_fails
fixed ISPC compilation fail caused by LLVM DIBuilder API change
This commit is contained in:
23
builtins.cpp
23
builtins.cpp
@@ -921,18 +921,22 @@ lDefineConstantInt(const char *name, int val, llvm::Module *module,
|
|||||||
// FIXME? DWARF says that this (and programIndex below) should
|
// FIXME? DWARF says that this (and programIndex below) should
|
||||||
// have the DW_AT_artifical attribute. It's not clear if this
|
// have the DW_AT_artifical attribute. It's not clear if this
|
||||||
// matters for anything though.
|
// 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+
|
#if !defined(LLVM_3_2) && !defined(LLVM_3_3) && !defined(LLVM_3_4) && !defined(LLVM_3_5)// LLVM 3.6+
|
||||||
m->diBuilder->createGlobalVariable(file,
|
llvm::Constant *sym_const_storagePtr = llvm::dyn_cast<llvm::Constant>(sym->storagePtr);
|
||||||
|
Assert(sym_const_storagePtr);
|
||||||
|
llvm::DIGlobalVariable var = m->diBuilder->createGlobalVariable(
|
||||||
|
file,
|
||||||
name,
|
name,
|
||||||
name,
|
name,
|
||||||
file,
|
file,
|
||||||
0 /* line */,
|
0 /* line */,
|
||||||
diType,
|
diType,
|
||||||
true /* static */,
|
true /* static */,
|
||||||
sym->storagePtr);
|
sym_const_storagePtr);
|
||||||
#else
|
#else
|
||||||
m->diBuilder->createGlobalVariable(name,
|
llvm::DIGlobalVariable var = m->diBuilder->createGlobalVariable(
|
||||||
|
name,
|
||||||
file,
|
file,
|
||||||
0 /* line */,
|
0 /* line */,
|
||||||
diType,
|
diType,
|
||||||
@@ -992,18 +996,21 @@ lDefineProgramIndex(llvm::Module *module, SymbolTable *symbolTable) {
|
|||||||
llvm::DIFile file;
|
llvm::DIFile file;
|
||||||
llvm::DIType diType = sym->type->GetDIType(file);
|
llvm::DIType diType = sym->type->GetDIType(file);
|
||||||
Assert(diType.Verify());
|
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+
|
#if !defined(LLVM_3_2) && !defined(LLVM_3_3) && !defined(LLVM_3_4) && !defined(LLVM_3_5)// LLVM 3.6+
|
||||||
m->diBuilder->createGlobalVariable(file,
|
llvm::Constant *sym_const_storagePtr = llvm::dyn_cast<llvm::Constant>(sym->storagePtr);
|
||||||
|
Assert(sym_const_storagePtr);
|
||||||
|
llvm::DIGlobalVariable var = m->diBuilder->createGlobalVariable(
|
||||||
|
file,
|
||||||
sym->name.c_str(),
|
sym->name.c_str(),
|
||||||
sym->name.c_str(),
|
sym->name.c_str(),
|
||||||
file,
|
file,
|
||||||
0 /* line */,
|
0 /* line */,
|
||||||
diType,
|
diType,
|
||||||
false /* static */,
|
false /* static */,
|
||||||
sym->storagePtr);
|
sym_const_storagePtr);
|
||||||
#else
|
#else
|
||||||
m->diBuilder->createGlobalVariable(sym->name.c_str(),
|
llvm::DIGlobalVariable var = m->diBuilder->createGlobalVariable(
|
||||||
|
sym->name.c_str(),
|
||||||
file,
|
file,
|
||||||
0 /* line */,
|
0 /* line */,
|
||||||
diType,
|
diType,
|
||||||
|
|||||||
11
module.cpp
11
module.cpp
@@ -607,18 +607,21 @@ Module::AddGlobalVariable(const std::string &name, const Type *type, Expr *initE
|
|||||||
|
|
||||||
if (diBuilder) {
|
if (diBuilder) {
|
||||||
llvm::DIFile file = pos.GetDIFile();
|
llvm::DIFile file = pos.GetDIFile();
|
||||||
llvm::DIGlobalVariable var =
|
|
||||||
#if !defined(LLVM_3_2) && !defined(LLVM_3_3) && !defined(LLVM_3_4) && !defined(LLVM_3_5)// LLVM 3.6+
|
#if !defined(LLVM_3_2) && !defined(LLVM_3_3) && !defined(LLVM_3_4) && !defined(LLVM_3_5)// LLVM 3.6+
|
||||||
diBuilder->createGlobalVariable(file,
|
llvm::Constant *sym_const_storagePtr = llvm::dyn_cast<llvm::Constant>(sym->storagePtr);
|
||||||
|
Assert(sym_const_storagePtr);
|
||||||
|
llvm::DIGlobalVariable var = diBuilder->createGlobalVariable(
|
||||||
|
file,
|
||||||
name,
|
name,
|
||||||
name,
|
name,
|
||||||
file,
|
file,
|
||||||
pos.first_line,
|
pos.first_line,
|
||||||
sym->type->GetDIType(file),
|
sym->type->GetDIType(file),
|
||||||
(sym->storageClass == SC_STATIC),
|
(sym->storageClass == SC_STATIC),
|
||||||
sym->storagePtr);
|
sym_const_storagePtr);
|
||||||
#else
|
#else
|
||||||
diBuilder->createGlobalVariable(name,
|
llvm::DIGlobalVariable var = diBuilder->createGlobalVariable(
|
||||||
|
name,
|
||||||
file,
|
file,
|
||||||
pos.first_line,
|
pos.first_line,
|
||||||
sym->type->GetDIType(file),
|
sym->type->GetDIType(file),
|
||||||
|
|||||||
Reference in New Issue
Block a user