소스 검색

Use TAG_auto_variable for local variable which converted from global … (#2602)

* Use TAG_auto_variable for local variable which converted from global variable.
Xiang Li 5 년 전
부모
커밋
815358229d

+ 1 - 1
lib/Transforms/Scalar/ScalarReplAggregatesHLSL.cpp

@@ -6247,7 +6247,7 @@ void PatchDebugInfo(const DebugInfoFinder &DbgFinder, Function *F, GlobalVariabl
   Name += DGV->getName();
 
   DIType *Ty = DGV->getType().resolve(EmptyMap);
-  DILocalVariable *ConvertedLocalVar = DIB.createLocalVariable(llvm::dwarf::Tag::DW_TAG_variable, Scope, Name, DGV->getFile(), DGV->getLine(), Ty);
+  DILocalVariable *ConvertedLocalVar = DIB.createLocalVariable(llvm::dwarf::Tag::DW_TAG_auto_variable, Scope, Name, DGV->getFile(), DGV->getLine(), Ty);
   DIB.insertDeclare(AI, ConvertedLocalVar, DIB.createExpression(ArrayRef<int64_t>()), Loc, AI->getNextNode());
 }
 

+ 3 - 3
tools/clang/test/HLSLFileCheck/dxil/debug/global_vec.hlsl

@@ -16,7 +16,7 @@ float4 main(float4 vec : COLOR, int index : INDEX) : SV_Target {
 // Exclude quoted source file (see readme)
 // CHECK-LABEL: {{!"[^"]*\\0A[^"]*"}}
 
-// CHECK: !DILocalVariable(tag: DW_TAG_variable, name: "global.MyGlobal
-// CHECK: !DILocalVariable(tag: DW_TAG_variable, name: "global.MyGlobal
-// CHECK: !DILocalVariable(tag: DW_TAG_variable, name: "global.MyGlobal
+// CHECK: !DILocalVariable(tag: DW_TAG_auto_variable, name: "global.MyGlobal
+// CHECK: !DILocalVariable(tag: DW_TAG_auto_variable, name: "global.MyGlobal
+// CHECK: !DILocalVariable(tag: DW_TAG_auto_variable, name: "global.MyGlobal
 

+ 1 - 1
tools/clang/test/HLSLFileCheck/dxil/debug/gv_od.hlsl

@@ -8,7 +8,7 @@
 // Exclude quoted source file (see readme)
 // CHECK-LABEL: {{!"[^"]*\\0A[^"]*"}}
 
-// CHECK: !DILocalVariable(tag: DW_TAG_variable, name: "global.gG"
+// CHECK: !DILocalVariable(tag: DW_TAG_auto_variable, name: "global.gG"
 
 static bool gG;