Revert "[spirv] add location for DebugDeclare (#3230)" (#3242)

This reverts commit 07ebfcff52.
This commit is contained in:
Jaebaek Seo 2020-11-04 16:24:12 -05:00 коммит произвёл GitHub
Родитель 4a0d84f369
Коммит b17cce22d3
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
7 изменённых файлов: 16 добавлений и 24 удалений

Просмотреть файл

@ -482,7 +482,6 @@ public:
SpirvDebugDeclare *createDebugDeclare( SpirvDebugDeclare *createDebugDeclare(
SpirvDebugLocalVariable *dbgVar, SpirvInstruction *var, SpirvDebugLocalVariable *dbgVar, SpirvInstruction *var,
SourceLocation loc = {},
llvm::Optional<SpirvDebugExpression *> dbgExpr = llvm::None); llvm::Optional<SpirvDebugExpression *> dbgExpr = llvm::None);
SpirvDebugFunction * SpirvDebugFunction *

Просмотреть файл

@ -2294,7 +2294,7 @@ private:
class SpirvDebugDeclare : public SpirvDebugInstruction { class SpirvDebugDeclare : public SpirvDebugInstruction {
public: public:
SpirvDebugDeclare(SpirvDebugLocalVariable *, SpirvInstruction *, SpirvDebugDeclare(SpirvDebugLocalVariable *, SpirvInstruction *,
SpirvDebugExpression *, SourceLocation loc); SpirvDebugExpression *);
DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvDebugDeclare) DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvDebugDeclare)

Просмотреть файл

@ -701,7 +701,7 @@ DeclResultIdMapper::createFnParam(const ParmVarDecl *param,
auto *debugLocalVar = spvBuilder.createDebugLocalVariable( auto *debugLocalVar = spvBuilder.createDebugLocalVariable(
type, name, info->source, line, column, info->scopeStack.back(), flags, type, name, info->source, line, column, info->scopeStack.back(), flags,
dbgArgNumber); dbgArgNumber);
spvBuilder.createDebugDeclare(debugLocalVar, fnParamInstr, loc); spvBuilder.createDebugDeclare(debugLocalVar, fnParamInstr);
} }
return fnParamInstr; return fnParamInstr;

Просмотреть файл

@ -890,13 +890,12 @@ SpirvDebugExpression *SpirvBuilder::getOrCreateNullDebugExpression() {
} }
SpirvDebugDeclare *SpirvBuilder::createDebugDeclare( SpirvDebugDeclare *SpirvBuilder::createDebugDeclare(
SpirvDebugLocalVariable *dbgVar, SpirvInstruction *var, SourceLocation loc, SpirvDebugLocalVariable *dbgVar, SpirvInstruction *var,
llvm::Optional<SpirvDebugExpression *> dbgExpr) { llvm::Optional<SpirvDebugExpression *> dbgExpr) {
auto *decl = new (context) auto *decl = new (context)
SpirvDebugDeclare(dbgVar, var, SpirvDebugDeclare(dbgVar, var,
dbgExpr.hasValue() ? dbgExpr.getValue() dbgExpr.hasValue() ? dbgExpr.getValue()
: getOrCreateNullDebugExpression(), : getOrCreateNullDebugExpression());
loc);
if (isa<SpirvFunctionParameter>(var)) { if (isa<SpirvFunctionParameter>(var)) {
assert(function && "found detached parameter"); assert(function && "found detached parameter");
function->addParameterDebugDeclare(decl); function->addParameterDebugDeclare(decl);

Просмотреть файл

@ -1074,7 +1074,7 @@ void SpirvEmitter::doFunctionDecl(const FunctionDecl *decl) {
auto *debugLocalVar = spvBuilder.createDebugLocalVariable( auto *debugLocalVar = spvBuilder.createDebugLocalVariable(
valueType, "this", info->source, line, column, valueType, "this", info->source, line, column,
info->scopeStack.back(), flags, 1); info->scopeStack.back(), flags, 1);
spvBuilder.createDebugDeclare(debugLocalVar, curThis, loc); spvBuilder.createDebugDeclare(debugLocalVar, curThis);
} }
isNonStaticMemberFn = true; isNonStaticMemberFn = true;
@ -1417,7 +1417,7 @@ void SpirvEmitter::doVarDecl(const VarDecl *decl) {
auto *debugLocalVar = spvBuilder.createDebugLocalVariable( auto *debugLocalVar = spvBuilder.createDebugLocalVariable(
decl->getType(), decl->getName(), info->source, line, column, decl->getType(), decl->getName(), info->source, line, column,
info->scopeStack.back(), flags); info->scopeStack.back(), flags);
spvBuilder.createDebugDeclare(debugLocalVar, var, loc); spvBuilder.createDebugDeclare(debugLocalVar, var);
} }
// Variables that are not externally visible and of opaque types should // Variables that are not externally visible and of opaque types should

Просмотреть файл

@ -893,12 +893,9 @@ SpirvDebugExpression::SpirvDebugExpression(
SpirvDebugDeclare::SpirvDebugDeclare(SpirvDebugLocalVariable *debugVar_, SpirvDebugDeclare::SpirvDebugDeclare(SpirvDebugLocalVariable *debugVar_,
SpirvInstruction *var_, SpirvInstruction *var_,
SpirvDebugExpression *expr, SpirvDebugExpression *expr)
SourceLocation loc)
: SpirvDebugInstruction(IK_DebugDeclare, /*opcode*/ 28u), : SpirvDebugInstruction(IK_DebugDeclare, /*opcode*/ 28u),
debugVar(debugVar_), var(var_), expression(expr) { debugVar(debugVar_), var(var_), expression(expr) {}
srcLoc = loc;
}
SpirvDebugLexicalBlock::SpirvDebugLexicalBlock(SpirvDebugSource *source_, SpirvDebugLexicalBlock::SpirvDebugLexicalBlock(SpirvDebugSource *source_,
uint32_t line_, uint32_t column_, uint32_t line_, uint32_t column_,

Просмотреть файл

@ -3,25 +3,22 @@
// TODO: FlagIsPublic is shown as FlagIsProtected|FlagIsPrivate. // TODO: FlagIsPublic is shown as FlagIsProtected|FlagIsPrivate.
// CHECK: [[set:%\d+]] = OpExtInstImport "OpenCL.DebugInfo.100" // CHECK: [[set:%\d+]] = OpExtInstImport "OpenCL.DebugInfo.100"
// CHECK: [[y:%\d+]] = OpExtInst %void [[set]] DebugLocalVariable {{%\d+}} {{%\d+}} {{%\d+}} 26 23 {{%\d+}} FlagIsLocal 2 // CHECK: [[y:%\d+]] = OpExtInst %void [[set]] DebugLocalVariable {{%\d+}} {{%\d+}} {{%\d+}} 23 23 {{%\d+}} FlagIsLocal 2
// CHECK: [[x:%\d+]] = OpExtInst %void [[set]] DebugLocalVariable {{%\d+}} {{%\d+}} {{%\d+}} 26 14 {{%\d+}} FlagIsLocal 1 // CHECK: [[x:%\d+]] = OpExtInst %void [[set]] DebugLocalVariable {{%\d+}} {{%\d+}} {{%\d+}} 23 14 {{%\d+}} FlagIsLocal 1
// CHECK: [[condition:%\d+]] = OpExtInst %void [[set]] DebugLocalVariable {{%\d+}} {{%\d+}} {{%\d+}} 33 8 {{%\d+}} FlagIsLocal // CHECK: [[condition:%\d+]] = OpExtInst %void [[set]] DebugLocalVariable {{%\d+}} {{%\d+}} {{%\d+}} 30 8 {{%\d+}} FlagIsLocal
// CHECK: [[expr:%\d+]] = OpExtInst %void [[set]] DebugExpression // CHECK: [[expr:%\d+]] = OpExtInst %void [[set]] DebugExpression
// CHECK: [[color:%\d+]] = OpExtInst %void [[set]] DebugLocalVariable {{%\d+}} {{%\d+}} {{%\d+}} 31 20 {{%\d+}} FlagIsLocal 1 // CHECK: [[color:%\d+]] = OpExtInst %void [[set]] DebugLocalVariable {{%\d+}} {{%\d+}} {{%\d+}} 28 20 {{%\d+}} FlagIsLocal 1
// CHECK: %color = OpFunctionParameter // CHECK: %color = OpFunctionParameter
// CHECK: {{%\d+}} = OpExtInst %void [[set]] DebugDeclare [[color]] %color [[expr]] // CHECK: {{%\d+}} = OpExtInst %void [[set]] DebugDeclare [[color]] %color [[expr]]
// CHECK: %condition = OpVariable // CHECK: %condition = OpVariable
// CHECK: OpLine {{%\d+}} 33 8
// CHECK: OpStore %condition %false // CHECK: OpStore %condition %false
// CHECK: {{%\d+}} = OpExtInst %void [[set]] DebugDeclare [[condition]] %condition [[expr]] // CHECK: {{%\d+}} = OpExtInst %void [[set]] DebugDeclare [[condition]] %condition [[expr]]
// CHECK: %x = OpFunctionParameter // CHECK: %x = OpFunctionParameter
// CHECK: %y = OpFunctionParameter // CHECK: %y = OpFunctionParameter
// CHECK: OpLine {{%\d+}} 26 14 // CHECK: {{%\d+}} = OpExtInst %void [[set]] DebugDeclare [[x]] %x [[expr]]
// CHECK-NEXT: {{%\d+}} = OpExtInst %void [[set]] DebugDeclare [[x]] %x [[expr]] // CHECK: {{%\d+}} = OpExtInst %void [[set]] DebugDeclare [[y]] %y [[expr]]
// CHECK-NEXT: OpLine {{%\d+}} 26 23
// CHECK-NEXT: {{%\d+}} = OpExtInst %void [[set]] DebugDeclare [[y]] %y [[expr]]
void foo(int x, float y) void foo(int x, float y)
{ {