Fix for r234201. IT SHOULD BE REVERTED IN FUTURE
This commit is contained in:
48
builtins.cpp
48
builtins.cpp
@@ -919,12 +919,16 @@ lDefineConstantInt(const char *name, int val, llvm::Module *module,
|
|||||||
if (m->diBuilder != NULL) {
|
if (m->diBuilder != NULL) {
|
||||||
llvm::DIFile file;
|
llvm::DIFile file;
|
||||||
llvm::DIType diType = sym->type->GetDIType(file);
|
llvm::DIType diType = sym->type->GetDIType(file);
|
||||||
|
#if defined(LLVM_3_2) || defined(LLVM_3_3) || defined(LLVM_3_4) || defined(LLVM_3_5) || defined(LLVM_3_6)
|
||||||
Assert(diType.Verify());
|
Assert(diType.Verify());
|
||||||
|
#else // LLVM 3.7+
|
||||||
|
//comming soon
|
||||||
|
#endif
|
||||||
// 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.
|
||||||
|
|
||||||
#if !defined(LLVM_3_2) && !defined(LLVM_3_3) && !defined(LLVM_3_4) && !defined(LLVM_3_5)// LLVM 3.6+
|
#if defined(LLVM_3_6)
|
||||||
llvm::Constant *sym_const_storagePtr = llvm::dyn_cast<llvm::Constant>(sym->storagePtr);
|
llvm::Constant *sym_const_storagePtr = llvm::dyn_cast<llvm::Constant>(sym->storagePtr);
|
||||||
Assert(sym_const_storagePtr);
|
Assert(sym_const_storagePtr);
|
||||||
llvm::DIGlobalVariable var = m->diBuilder->createGlobalVariable(
|
llvm::DIGlobalVariable var = m->diBuilder->createGlobalVariable(
|
||||||
@@ -936,7 +940,7 @@ lDefineConstantInt(const char *name, int val, llvm::Module *module,
|
|||||||
diType,
|
diType,
|
||||||
true /* static */,
|
true /* static */,
|
||||||
sym_const_storagePtr);
|
sym_const_storagePtr);
|
||||||
#else
|
#elif defined(LLVM_3_2) || defined(LLVM_3_3) || defined(LLVM_3_4) || defined(LLVM_3_5)
|
||||||
llvm::DIGlobalVariable var = m->diBuilder->createGlobalVariable(
|
llvm::DIGlobalVariable var = m->diBuilder->createGlobalVariable(
|
||||||
name,
|
name,
|
||||||
file,
|
file,
|
||||||
@@ -944,8 +948,24 @@ lDefineConstantInt(const char *name, int val, llvm::Module *module,
|
|||||||
diType,
|
diType,
|
||||||
true /* static */,
|
true /* static */,
|
||||||
sym->storagePtr);
|
sym->storagePtr);
|
||||||
|
#else
|
||||||
|
llvm::Constant *sym_const_storagePtr = llvm::dyn_cast<llvm::Constant>(sym->storagePtr);
|
||||||
|
Assert(sym_const_storagePtr);
|
||||||
|
m->diBuilder->createGlobalVariable(
|
||||||
|
file,
|
||||||
|
name,
|
||||||
|
name,
|
||||||
|
file,
|
||||||
|
0 /* line */,
|
||||||
|
diType,
|
||||||
|
true /* static */,
|
||||||
|
sym_const_storagePtr);
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(LLVM_3_2) || defined(LLVM_3_3) || defined(LLVM_3_4) || defined(LLVM_3_5) || defined(LLVM_3_6)
|
||||||
Assert(var.Verify());
|
Assert(var.Verify());
|
||||||
|
#else // LLVM 3.7+
|
||||||
|
//comming soon
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -997,8 +1017,12 @@ lDefineProgramIndex(llvm::Module *module, SymbolTable *symbolTable) {
|
|||||||
if (m->diBuilder != NULL) {
|
if (m->diBuilder != NULL) {
|
||||||
llvm::DIFile file;
|
llvm::DIFile file;
|
||||||
llvm::DIType diType = sym->type->GetDIType(file);
|
llvm::DIType diType = sym->type->GetDIType(file);
|
||||||
|
#if defined(LLVM_3_2) || defined(LLVM_3_3) || defined(LLVM_3_4) || defined(LLVM_3_5) || defined(LLVM_3_6)
|
||||||
Assert(diType.Verify());
|
Assert(diType.Verify());
|
||||||
#if !defined(LLVM_3_2) && !defined(LLVM_3_3) && !defined(LLVM_3_4) && !defined(LLVM_3_5)// LLVM 3.6+
|
#else // LLVM 3.7+
|
||||||
|
//comming soon
|
||||||
|
#endif
|
||||||
|
#if defined(LLVM_3_6)// LLVM 3.6+
|
||||||
llvm::Constant *sym_const_storagePtr = llvm::dyn_cast<llvm::Constant>(sym->storagePtr);
|
llvm::Constant *sym_const_storagePtr = llvm::dyn_cast<llvm::Constant>(sym->storagePtr);
|
||||||
Assert(sym_const_storagePtr);
|
Assert(sym_const_storagePtr);
|
||||||
llvm::DIGlobalVariable var = m->diBuilder->createGlobalVariable(
|
llvm::DIGlobalVariable var = m->diBuilder->createGlobalVariable(
|
||||||
@@ -1010,7 +1034,7 @@ lDefineProgramIndex(llvm::Module *module, SymbolTable *symbolTable) {
|
|||||||
diType,
|
diType,
|
||||||
false /* static */,
|
false /* static */,
|
||||||
sym_const_storagePtr);
|
sym_const_storagePtr);
|
||||||
#else
|
#elif defined(LLVM_3_2) || defined(LLVM_3_3) || defined(LLVM_3_4) || defined(LLVM_3_5)
|
||||||
llvm::DIGlobalVariable var = m->diBuilder->createGlobalVariable(
|
llvm::DIGlobalVariable var = m->diBuilder->createGlobalVariable(
|
||||||
sym->name.c_str(),
|
sym->name.c_str(),
|
||||||
file,
|
file,
|
||||||
@@ -1018,8 +1042,24 @@ lDefineProgramIndex(llvm::Module *module, SymbolTable *symbolTable) {
|
|||||||
diType,
|
diType,
|
||||||
false /* static */,
|
false /* static */,
|
||||||
sym->storagePtr);
|
sym->storagePtr);
|
||||||
|
#else
|
||||||
|
llvm::Constant *sym_const_storagePtr = llvm::dyn_cast<llvm::Constant>(sym->storagePtr);
|
||||||
|
Assert(sym_const_storagePtr);
|
||||||
|
m->diBuilder->createGlobalVariable(
|
||||||
|
file,
|
||||||
|
sym->name.c_str(),
|
||||||
|
sym->name.c_str(),
|
||||||
|
file,
|
||||||
|
0 /* line */,
|
||||||
|
diType,
|
||||||
|
false /* static */,
|
||||||
|
sym_const_storagePtr);
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(LLVM_3_2) || defined(LLVM_3_3) || defined(LLVM_3_4) || defined(LLVM_3_5) || defined(LLVM_3_6)
|
||||||
Assert(var.Verify());
|
Assert(var.Verify());
|
||||||
|
#else // LLVM 3.7+
|
||||||
|
//comming soon
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
37
ctx.cpp
37
ctx.cpp
@@ -338,14 +338,23 @@ FunctionEmitContext::FunctionEmitContext(Function *func, Symbol *funSym,
|
|||||||
/* If debugging is enabled, tell the debug information emission
|
/* If debugging is enabled, tell the debug information emission
|
||||||
code about this new function */
|
code about this new function */
|
||||||
diFile = funcStartPos.GetDIFile();
|
diFile = funcStartPos.GetDIFile();
|
||||||
|
|
||||||
|
#if defined(LLVM_3_2) || defined(LLVM_3_3) || defined(LLVM_3_4) || defined(LLVM_3_5) || defined(LLVM_3_6)
|
||||||
AssertPos(currentPos, diFile.Verify());
|
AssertPos(currentPos, diFile.Verify());
|
||||||
|
#else // LLVM 3.7
|
||||||
|
//comming soon
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(LLVM_3_2) || defined(LLVM_3_3)
|
#if defined(LLVM_3_2) || defined(LLVM_3_3)
|
||||||
llvm::DIScope scope = llvm::DIScope(m->diBuilder->getCU());
|
llvm::DIScope scope = llvm::DIScope(m->diBuilder->getCU());
|
||||||
#else // LLVM_3_4+
|
#else // LLVM_3_4+
|
||||||
llvm::DIScope scope = llvm::DIScope(m->diCompileUnit);
|
llvm::DIScope scope = llvm::DIScope(m->diCompileUnit);
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(LLVM_3_2) || defined(LLVM_3_3) || defined(LLVM_3_4) || defined(LLVM_3_5) || defined(LLVM_3_6)
|
||||||
AssertPos(currentPos, scope.Verify());
|
AssertPos(currentPos, scope.Verify());
|
||||||
|
#else // LLVM 3.7
|
||||||
|
//comming soon
|
||||||
|
#endif
|
||||||
|
|
||||||
const FunctionType *functionType = function->GetType();
|
const FunctionType *functionType = function->GetType();
|
||||||
llvm::DIType diSubprogramType;
|
llvm::DIType diSubprogramType;
|
||||||
@@ -353,7 +362,11 @@ FunctionEmitContext::FunctionEmitContext(Function *func, Symbol *funSym,
|
|||||||
AssertPos(currentPos, m->errorCount > 0);
|
AssertPos(currentPos, m->errorCount > 0);
|
||||||
else {
|
else {
|
||||||
diSubprogramType = functionType->GetDIType(scope);
|
diSubprogramType = functionType->GetDIType(scope);
|
||||||
|
#if defined(LLVM_3_2) || defined(LLVM_3_3) || defined(LLVM_3_4) || defined(LLVM_3_5) || defined(LLVM_3_6)
|
||||||
AssertPos(currentPos, diSubprogramType.Verify());
|
AssertPos(currentPos, diSubprogramType.Verify());
|
||||||
|
#else // LLVM 3.7
|
||||||
|
//comming soon
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(LLVM_3_2) && !defined(LLVM_3_3)
|
#if !defined(LLVM_3_2) && !defined(LLVM_3_3)
|
||||||
@@ -381,7 +394,11 @@ FunctionEmitContext::FunctionEmitContext(Function *func, Symbol *funSym,
|
|||||||
firstLine,
|
firstLine,
|
||||||
flags,
|
flags,
|
||||||
isOptimized, llvmFunction);
|
isOptimized, llvmFunction);
|
||||||
|
#if defined(LLVM_3_2) || defined(LLVM_3_3) || defined(LLVM_3_4) || defined(LLVM_3_5) || defined(LLVM_3_6)
|
||||||
AssertPos(currentPos, diSubprogram.Verify());
|
AssertPos(currentPos, diSubprogram.Verify());
|
||||||
|
#else // LLVM 3.7
|
||||||
|
//comming soon
|
||||||
|
#endif
|
||||||
|
|
||||||
/* And start a scope representing the initial function scope */
|
/* And start a scope representing the initial function scope */
|
||||||
StartScope();
|
StartScope();
|
||||||
@@ -1662,7 +1679,11 @@ FunctionEmitContext::StartScope() {
|
|||||||
// as the last argument
|
// as the last argument
|
||||||
currentPos.first_column);
|
currentPos.first_column);
|
||||||
#endif // LLVM 3.2, 3.3, 3.4 and 3.6+
|
#endif // LLVM 3.2, 3.3, 3.4 and 3.6+
|
||||||
|
#if defined(LLVM_3_2) || defined(LLVM_3_3) || defined(LLVM_3_4) || defined(LLVM_3_5) || defined(LLVM_3_6)
|
||||||
AssertPos(currentPos, lexicalBlock.Verify());
|
AssertPos(currentPos, lexicalBlock.Verify());
|
||||||
|
#else // LLVM 3.7
|
||||||
|
//comming soon
|
||||||
|
#endif
|
||||||
debugScopes.push_back(lexicalBlock);
|
debugScopes.push_back(lexicalBlock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1691,7 +1712,11 @@ FunctionEmitContext::EmitVariableDebugInfo(Symbol *sym) {
|
|||||||
|
|
||||||
llvm::DIScope scope = GetDIScope();
|
llvm::DIScope scope = GetDIScope();
|
||||||
llvm::DIType diType = sym->type->GetDIType(scope);
|
llvm::DIType diType = sym->type->GetDIType(scope);
|
||||||
|
#if defined(LLVM_3_2) || defined(LLVM_3_3) || defined(LLVM_3_4) || defined(LLVM_3_5) || defined(LLVM_3_6)
|
||||||
AssertPos(currentPos, diType.Verify());
|
AssertPos(currentPos, diType.Verify());
|
||||||
|
#else // LLVM 3.7
|
||||||
|
//comming soon
|
||||||
|
#endif
|
||||||
llvm::DIVariable var =
|
llvm::DIVariable var =
|
||||||
m->diBuilder->createLocalVariable(llvm::dwarf::DW_TAG_auto_variable,
|
m->diBuilder->createLocalVariable(llvm::dwarf::DW_TAG_auto_variable,
|
||||||
scope,
|
scope,
|
||||||
@@ -1700,7 +1725,11 @@ FunctionEmitContext::EmitVariableDebugInfo(Symbol *sym) {
|
|||||||
sym->pos.first_line,
|
sym->pos.first_line,
|
||||||
diType,
|
diType,
|
||||||
true /* preserve through opts */);
|
true /* preserve through opts */);
|
||||||
|
#if defined(LLVM_3_2) || defined(LLVM_3_3) || defined(LLVM_3_4) || defined(LLVM_3_5) || defined(LLVM_3_6)
|
||||||
AssertPos(currentPos, var.Verify());
|
AssertPos(currentPos, var.Verify());
|
||||||
|
#else // LLVM 3.7
|
||||||
|
//comming soon
|
||||||
|
#endif
|
||||||
#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+
|
||||||
llvm::DIExpression E = m->diBuilder->createExpression();
|
llvm::DIExpression E = m->diBuilder->createExpression();
|
||||||
llvm::Instruction *declareInst =
|
llvm::Instruction *declareInst =
|
||||||
@@ -1720,7 +1749,11 @@ FunctionEmitContext::EmitFunctionParameterDebugInfo(Symbol *sym, int argNum) {
|
|||||||
|
|
||||||
llvm::DIScope scope = diSubprogram;
|
llvm::DIScope scope = diSubprogram;
|
||||||
llvm::DIType diType = sym->type->GetDIType(scope);
|
llvm::DIType diType = sym->type->GetDIType(scope);
|
||||||
|
#if defined(LLVM_3_2) || defined(LLVM_3_3) || defined(LLVM_3_4) || defined(LLVM_3_5) || defined(LLVM_3_6)
|
||||||
AssertPos(currentPos, diType.Verify());
|
AssertPos(currentPos, diType.Verify());
|
||||||
|
#else // LLVM 3.7
|
||||||
|
//comming soon
|
||||||
|
#endif
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
|
|
||||||
llvm::DIVariable var =
|
llvm::DIVariable var =
|
||||||
@@ -1733,7 +1766,11 @@ FunctionEmitContext::EmitFunctionParameterDebugInfo(Symbol *sym, int argNum) {
|
|||||||
true /* preserve through opts */,
|
true /* preserve through opts */,
|
||||||
flags,
|
flags,
|
||||||
argNum+1);
|
argNum+1);
|
||||||
|
#if defined(LLVM_3_2) || defined(LLVM_3_3) || defined(LLVM_3_4) || defined(LLVM_3_5) || defined(LLVM_3_6)
|
||||||
AssertPos(currentPos, var.Verify());
|
AssertPos(currentPos, var.Verify());
|
||||||
|
#else // LLVM 3.7
|
||||||
|
//comming soon
|
||||||
|
#endif
|
||||||
#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+
|
||||||
llvm::DIExpression E = m->diBuilder->createExpression();
|
llvm::DIExpression E = m->diBuilder->createExpression();
|
||||||
llvm::Instruction *declareInst =
|
llvm::Instruction *declareInst =
|
||||||
|
|||||||
4
ispc.cpp
4
ispc.cpp
@@ -1352,7 +1352,11 @@ SourcePos::GetDIFile() const {
|
|||||||
std::string directory, filename;
|
std::string directory, filename;
|
||||||
GetDirectoryAndFileName(g->currentDirectory, name, &directory, &filename);
|
GetDirectoryAndFileName(g->currentDirectory, name, &directory, &filename);
|
||||||
llvm::DIFile ret = m->diBuilder->createFile(filename, directory);
|
llvm::DIFile ret = m->diBuilder->createFile(filename, directory);
|
||||||
|
#if defined(LLVM_3_2) || defined(LLVM_3_3) || defined(LLVM_3_4) || defined(LLVM_3_5) || defined(LLVM_3_6)
|
||||||
Assert(ret.Verify());
|
Assert(ret.Verify());
|
||||||
|
#else // LLVM 3.7+
|
||||||
|
//comming soon
|
||||||
|
#endif
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user