r290155 - Update for LLVM global variable debug info API change.

Adrian Prantl via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 19 18:10:02 PST 2016


Author: adrian
Date: Mon Dec 19 20:10:02 2016
New Revision: 290155

URL: http://llvm.org/viewvc/llvm-project?rev=290155&view=rev
Log:
Update for LLVM global variable debug info API change.

This reapplies r289921.

Modified:
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
    cfe/trunk/lib/CodeGen/CGDebugInfo.h
    cfe/trunk/test/CodeGen/2009-10-20-GlobalDebug.c
    cfe/trunk/test/CodeGen/2010-08-10-DbgConstant.c
    cfe/trunk/test/CodeGen/debug-info-atomic.c
    cfe/trunk/test/CodeGen/debug-info-global-constant.c
    cfe/trunk/test/CodeGen/debug-info-static-const-fp.c
    cfe/trunk/test/CodeGen/debug-info-static.c
    cfe/trunk/test/CodeGenCXX/debug-info-global.cpp
    cfe/trunk/test/CodeGenCXX/debug-info-static-member.cpp
    cfe/trunk/test/CodeGenCXX/debug-info-template-member.cpp
    cfe/trunk/test/CodeGenCXX/debug-info-template.cpp
    cfe/trunk/test/CodeGenCXX/debug-info.cpp
    cfe/trunk/test/CodeGenCXX/inline-dllexport-member.cpp

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=290155&r1=290154&r2=290155&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Mon Dec 19 20:10:02 2016
@@ -2855,7 +2855,7 @@ CGDebugInfo::getGlobalVariableForwardDec
   auto Align = getDeclAlignIfRequired(VD, CGM.getContext());
   auto *GV = DBuilder.createTempGlobalVariableFwdDecl(
       DContext, Name, LinkageName, Unit, Line, getOrCreateType(T, Unit),
-      !VD->isExternallyVisible(), nullptr, nullptr, Align);
+      !VD->isExternallyVisible(), nullptr, Align);
   FwdDeclReplaceMap.emplace_back(
       std::piecewise_construct,
       std::make_tuple(cast<VarDecl>(VD->getCanonicalDecl())),
@@ -2873,8 +2873,12 @@ llvm::DINode *CGDebugInfo::getDeclaratio
                            getOrCreateFile(TD->getLocation()));
   auto I = DeclCache.find(D->getCanonicalDecl());
 
-  if (I != DeclCache.end())
-    return dyn_cast_or_null<llvm::DINode>(I->second);
+  if (I != DeclCache.end()) {
+    auto N = I->second;
+    if (auto *GVE = dyn_cast_or_null<llvm::DIGlobalVariableExpression>(N))
+      return GVE->getVariable();
+    return dyn_cast_or_null<llvm::DINode>(N);
+  }
 
   // No definition for now. Emit a forward definition that might be
   // merged with a potential upcoming definition.
@@ -3650,10 +3654,10 @@ CGDebugInfo::getOrCreateStaticDataMember
   return CreateRecordStaticField(D, Ctxt, cast<RecordDecl>(DC));
 }
 
-llvm::DIGlobalVariable *CGDebugInfo::CollectAnonRecordDecls(
+llvm::DIGlobalVariableExpression *CGDebugInfo::CollectAnonRecordDecls(
     const RecordDecl *RD, llvm::DIFile *Unit, unsigned LineNo,
     StringRef LinkageName, llvm::GlobalVariable *Var, llvm::DIScope *DContext) {
-  llvm::DIGlobalVariable *GV = nullptr;
+  llvm::DIGlobalVariableExpression *GVE = nullptr;
 
   for (const auto *Field : RD->fields()) {
     llvm::DIType *FieldTy = getOrCreateType(Field->getType(), Unit);
@@ -3662,16 +3666,17 @@ llvm::DIGlobalVariable *CGDebugInfo::Col
     // Ignore unnamed fields, but recurse into anonymous records.
     if (FieldName.empty()) {
       if (const auto *RT = dyn_cast<RecordType>(Field->getType()))
-        GV = CollectAnonRecordDecls(RT->getDecl(), Unit, LineNo, LinkageName,
+        GVE = CollectAnonRecordDecls(RT->getDecl(), Unit, LineNo, LinkageName,
                                     Var, DContext);
       continue;
     }
     // Use VarDecl's Tag, Scope and Line number.
-    GV = DBuilder.createGlobalVariable(DContext, FieldName, LinkageName, Unit,
-                                       LineNo, FieldTy, Var->hasLocalLinkage());
-    Var->addDebugInfo(GV);
+    GVE = DBuilder.createGlobalVariableExpression(
+        DContext, FieldName, LinkageName, Unit, LineNo, FieldTy,
+        Var->hasLocalLinkage());
+    Var->addDebugInfo(GVE);
   }
-  return GV;
+  return GVE;
 }
 
 void CGDebugInfo::EmitGlobalVariable(llvm::GlobalVariable *Var,
@@ -3684,7 +3689,8 @@ void CGDebugInfo::EmitGlobalVariable(llv
   // it to the llvm::GlobalVariable.
   auto Cached = DeclCache.find(D->getCanonicalDecl());
   if (Cached != DeclCache.end())
-    return Var->addDebugInfo(cast<llvm::DIGlobalVariable>(Cached->second));
+    return Var->addDebugInfo(
+        cast<llvm::DIGlobalVariableExpression>(Cached->second));
 
   // Create global variable debug descriptor.
   llvm::DIFile *Unit = nullptr;
@@ -3696,7 +3702,7 @@ void CGDebugInfo::EmitGlobalVariable(llv
 
   // Attempt to store one global variable for the declaration - even if we
   // emit a lot of fields.
-  llvm::DIGlobalVariable *GV = nullptr;
+  llvm::DIGlobalVariableExpression *GVE = nullptr;
 
   // If this is an anonymous union then we'll want to emit a global
   // variable for each member of the anonymous union so that it's possible
@@ -3705,16 +3711,16 @@ void CGDebugInfo::EmitGlobalVariable(llv
     const RecordDecl *RD = T->castAs<RecordType>()->getDecl();
     assert(RD->isAnonymousStructOrUnion() &&
            "unnamed non-anonymous struct or union?");
-    GV = CollectAnonRecordDecls(RD, Unit, LineNo, LinkageName, Var, DContext);
+    GVE = CollectAnonRecordDecls(RD, Unit, LineNo, LinkageName, Var, DContext);
   } else {
     auto Align = getDeclAlignIfRequired(D, CGM.getContext());
-    GV = DBuilder.createGlobalVariable(
+    GVE = DBuilder.createGlobalVariableExpression(
         DContext, DeclName, LinkageName, Unit, LineNo, getOrCreateType(T, Unit),
         Var->hasLocalLinkage(), /*Expr=*/nullptr,
         getOrCreateStaticDataMemberDeclarationOrNull(D), Align);
-    Var->addDebugInfo(GV);
+    Var->addDebugInfo(GVE);
   }
-  DeclCache[D->getCanonicalDecl()].reset(GV);
+  DeclCache[D->getCanonicalDecl()].reset(GVE);
 }
 
 void CGDebugInfo::EmitGlobalVariable(const ValueDecl *VD, const APValue &Init) {
@@ -3768,7 +3774,7 @@ void CGDebugInfo::EmitGlobalVariable(con
       InitExpr = DBuilder.createConstantValueExpression(
           Init.getFloat().bitcastToAPInt().getZExtValue());
   }
-  GV.reset(DBuilder.createGlobalVariable(
+  GV.reset(DBuilder.createGlobalVariableExpression(
       DContext, Name, StringRef(), Unit, getLineNumber(VD->getLocation()), Ty,
       true, InitExpr, getOrCreateStaticDataMemberDeclarationOrNull(VarD),
       Align));
@@ -3915,6 +3921,8 @@ void CGDebugInfo::finalize() {
     else
       Repl = it->second;
 
+    if (auto *GVE = dyn_cast_or_null<llvm::DIGlobalVariableExpression>(Repl))
+      Repl = GVE->getVariable();
     DBuilder.replaceTemporary(std::move(FwdDecl), cast<llvm::MDNode>(Repl));
   }
 

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.h?rev=290155&r1=290154&r2=290155&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.h (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.h Mon Dec 19 20:10:02 2016
@@ -496,14 +496,14 @@ private:
   llvm::DIGlobalVariable *
   getGlobalVariableForwardDeclaration(const VarDecl *VD);
 
-  /// \brief Return a global variable that represents one of the
-  /// collection of global variables created for an anonmyous union.
+  /// Return a global variable that represents one of the collection of global
+  /// variables created for an anonmyous union.
   ///
   /// Recursively collect all of the member fields of a global
   /// anonymous decl and create static variables for them. The first
   /// time this is called it needs to be on a union and then from
   /// there we can have additional unnamed fields.
-  llvm::DIGlobalVariable *
+  llvm::DIGlobalVariableExpression *
   CollectAnonRecordDecls(const RecordDecl *RD, llvm::DIFile *Unit,
                          unsigned LineNo, StringRef LinkageName,
                          llvm::GlobalVariable *Var, llvm::DIScope *DContext);

Modified: cfe/trunk/test/CodeGen/2009-10-20-GlobalDebug.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2009-10-20-GlobalDebug.c?rev=290155&r1=290154&r2=290155&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/2009-10-20-GlobalDebug.c (original)
+++ cfe/trunk/test/CodeGen/2009-10-20-GlobalDebug.c Mon Dec 19 20:10:02 2016
@@ -10,9 +10,11 @@ int main() {
   return 0;
 }
 
-// CHECK: [[L]] = distinct !DIGlobalVariable(name: "localstatic"
-// CHECK-NOT:               linkageName:
-// CHECK-SAME:              line: 9,
-// CHECK: [[G]] = distinct !DIGlobalVariable(name: "global"
-// CHECK-NOT:               linkageName:
-// CHECK-SAME:              line: 7,
+// CHECK: [[L]] = !DIGlobalVariableExpression(var: [[LV:.*]])
+// CHECK: [[LV]] = distinct !DIGlobalVariable(name: "localstatic"
+// CHECK-NOT:                                 linkageName:
+// CHECK-SAME:                                line: 9,
+// CHECK: [[G]] = !DIGlobalVariableExpression(var: [[GV:.*]])
+// CHECK: [[GV]] = distinct !DIGlobalVariable(name: "global"
+// CHECK-NOT:                                 linkageName:
+// CHECK-SAME:                                line: 7,

Modified: cfe/trunk/test/CodeGen/2010-08-10-DbgConstant.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2010-08-10-DbgConstant.c?rev=290155&r1=290154&r2=290155&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/2010-08-10-DbgConstant.c (original)
+++ cfe/trunk/test/CodeGen/2010-08-10-DbgConstant.c Mon Dec 19 20:10:02 2016
@@ -1,5 +1,5 @@
 // RUN: %clang_cc1 -S -emit-llvm -debug-info-kind=limited  %s -o - | FileCheck %s
-// CHECK: !DIGlobalVariable({{.*}}, expr: [[EXPR:![0-9]+]])
+// CHECK: !DIGlobalVariableExpression(var: [[VAR:.*]], expr: [[EXPR:![0-9]+]])
 // CHECK: [[EXPR]] = !DIExpression(DW_OP_constu, 201, DW_OP_stack_value)
 
 static const unsigned int ro = 201;

Modified: cfe/trunk/test/CodeGen/debug-info-atomic.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/debug-info-atomic.c?rev=290155&r1=290154&r2=290155&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/debug-info-atomic.c (original)
+++ cfe/trunk/test/CodeGen/debug-info-atomic.c Mon Dec 19 20:10:02 2016
@@ -1,7 +1,8 @@
 // RUN: %clang -g -c -std=c11 -S -emit-llvm -o - %s | FileCheck %s
 
-// CHECK: !DIGlobalVariable(name: "i"{{.*}}type: !5, isLocal: false, isDefinition: true)
-// CHECK: !5 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !6)
-// CHECK: !6 = !DIDerivedType(tag: DW_TAG_atomic_type, baseType: !7)
-// CHECK: !7 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
+// CHECK: !DIGlobalVariable(name: "i"
+// CHECK-SAME: type: ![[T:.*]], isLocal: false, isDefinition: true)
+// CHECK: ![[T]] = !DIDerivedType(tag: DW_TAG_const_type, baseType: ![[BT:.*]])
+// CHECK: ![[BT]] = !DIDerivedType(tag: DW_TAG_atomic_type, baseType: ![[BTT:.*]])
+// CHECK: ![[BTT]] = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
 _Atomic const int i;

Modified: cfe/trunk/test/CodeGen/debug-info-global-constant.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/debug-info-global-constant.c?rev=290155&r1=290154&r2=290155&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/debug-info-global-constant.c (original)
+++ cfe/trunk/test/CodeGen/debug-info-global-constant.c Mon Dec 19 20:10:02 2016
@@ -5,8 +5,8 @@
 // exactly once.
 
 // CHECK: @i = internal constant i32 1, align 4, !dbg ![[I:[0-9]+]]
-// CHECK: ![[I]] = distinct !DIGlobalVariable(name: "i",
-// CHECK-SAME:                                expr: ![[EXPR:[0-9]+]]
+// CHECK: ![[I]] = !DIGlobalVariableExpression(var: ![[VAR:.*]], expr: ![[EXPR:[0-9]+]])
+// CHECK: ![[VAR]] = distinct !DIGlobalVariable(name: "i",
 // CHECK: !DICompileUnit({{.*}}globals: ![[GLOBALS:[0-9]+]])
 // CHECK: ![[GLOBALS]] = !{![[I]]}
 // CHECK: ![[EXPR]] = !DIExpression(DW_OP_constu, 1, DW_OP_stack_value)

Modified: cfe/trunk/test/CodeGen/debug-info-static-const-fp.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/debug-info-static-const-fp.c?rev=290155&r1=290154&r2=290155&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/debug-info-static-const-fp.c (original)
+++ cfe/trunk/test/CodeGen/debug-info-static-const-fp.c Mon Dec 19 20:10:02 2016
@@ -33,14 +33,22 @@ int main() {
   return hVal + fVal + dVal + ldVal;
 }
 
-// CHECK: !DIGlobalVariable(name: "hVal", {{.*}}, isLocal: true, isDefinition: true, expr: ![[HEXPR:[0-9]+]]
-// CHECK: ![[HEXPR]] = !DIExpression(DW_OP_constu, 16502, DW_OP_stack_value)
+// CHECK: !DIGlobalVariableExpression(var: [[HVAL:.*]], expr: [[HEXPR:.*]])
+// CHECK: [[HVAL]] = distinct !DIGlobalVariable(name: "hVal",
+// CHECK-SAME:                                  isLocal: true, isDefinition: true
+// CHECK: [[HEXPR]] = !DIExpression(DW_OP_constu, 16502, DW_OP_stack_value)
 
-// CHECK: !DIGlobalVariable(name: "fVal", {{.*}}, isLocal: true, isDefinition: true, expr: ![[FEXPR:[0-9]+]]
-// CHECK: ![[FEXPR]] = !DIExpression(DW_OP_constu, 3238681178, DW_OP_stack_value)
+// CHECK: !DIGlobalVariableExpression(var: [[FVAL:.*]], expr: [[FEXPR:.*]])
+// CHECK: [[FVAL]] = distinct !DIGlobalVariable(name: "fVal",
+// CHECK-SAME:                                  isLocal: true, isDefinition: true
+// CHECK: [[FEXPR]] = !DIExpression(DW_OP_constu, 3238681178, DW_OP_stack_value)
 
-// CHECK: !DIGlobalVariable(name: "dVal", {{.*}}, isLocal: true, isDefinition: true, expr: ![[DEXPR:[0-9]+]]
-// CHECK: ![[DEXPR]] = !DIExpression(DW_OP_constu, 4658387303597904457, DW_OP_stack_value)
+// CHECK: !DIGlobalVariableExpression(var: [[DVAL:.*]], expr: [[DEXPR:.*]])
+// CHECK: [[DVAL]] = distinct !DIGlobalVariable(name: "dVal",
+// CHECK-SAME:                                  isLocal: true, isDefinition: true
+// CHECK: [[DEXPR]] = !DIExpression(DW_OP_constu, 4658387303597904457, DW_OP_stack_value)
 
-// CHECK-LDlg: !DIGlobalVariable(name: "ldVal", {{.*}}, isLocal: true, isDefinition: true)
-// CHECK-LDsm: !DIGlobalVariable(name: "ldVal", {{.*}}, isLocal: true, isDefinition: true, expr:
+// CHECK-LDlg-DAG: [[LDVAL:.*]] = distinct !DIGlobalVariable(name: "ldVal", {{.*}}, isLocal: true, isDefinition: true)
+// CHECK-LDlg-DAG: !DIGlobalVariableExpression(var: [[LDVAL]])
+// CHECK-LDsm-DAG: [[LDVAL:.*]] = distinct !DIGlobalVariable(name: "ldVal", {{.*}}, isLocal: true, isDefinition: true)
+// CHECK-LDsm-DAG: !DIGlobalVariableExpression(var: [[LDVAL]], expr:

Modified: cfe/trunk/test/CodeGen/debug-info-static.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/debug-info-static.c?rev=290155&r1=290154&r2=290155&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/debug-info-static.c (original)
+++ cfe/trunk/test/CodeGen/debug-info-static.c Mon Dec 19 20:10:02 2016
@@ -2,7 +2,8 @@
 
 // CHECK: @f.xyzzy = internal global i32 0, align 4, !dbg [[XYZZY:![0-9]+]]
 
-// CHECK: [[XYZZY]] = distinct !DIGlobalVariable
+// CHECK: [[XYZZY]] = !DIGlobalVariableExpression(var: [[VAR:.*]])
+// CHECK: [[VAR]] = distinct !DIGlobalVariable
 void f(void)
 {
    static int xyzzy;

Modified: cfe/trunk/test/CodeGenCXX/debug-info-global.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-global.cpp?rev=290155&r1=290154&r2=290155&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-global.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-info-global.cpp Mon Dec 19 20:10:02 2016
@@ -15,7 +15,8 @@ int f1() {
 
 // CHECK: [[GLOBALS]] = !{[[CNST:![0-9]*]]}
 
-// CHECK: [[CNST]] = distinct !DIGlobalVariable(name: "cnst",
-// CHECK-SAME:                                  scope: [[NS:![0-9]*]]
+// CHECK: [[CNST]] = !DIGlobalVariableExpression(var: [[CNSTV:.*]], expr:
+// CHECK: [[CNSTV]] = distinct !DIGlobalVariable(name: "cnst",
+// CHECK-SAME:                                   scope: [[NS:![0-9]*]]
 // CHECK: [[NS]] = !DINamespace(name: "ns"
 

Modified: cfe/trunk/test/CodeGenCXX/debug-info-static-member.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-static-member.cpp?rev=290155&r1=290154&r2=290155&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-static-member.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-info-static-member.cpp Mon Dec 19 20:10:02 2016
@@ -32,7 +32,9 @@ public:
 // why the definition of "a" comes before the declarations while
 // "b" and "c" come after.
 
-// CHECK: [[A]] = distinct !DIGlobalVariable(name: "a", {{.*}} declaration: ![[DECL_A:[0-9]+]])
+// CHECK: [[A]] = !DIGlobalVariableExpression(var: [[AV:.*]])
+// CHECK: [[AV]] = distinct !DIGlobalVariable(name: "a",
+// CHECK-SAME:                                declaration: ![[DECL_A:[0-9]+]])
 //
 // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, name: "X"{{.*}}, identifier: "_ZTS1X")
 // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "anon_static_decl_struct"
@@ -43,7 +45,9 @@ public:
 // CHECK: !DIDerivedType(tag: DW_TAG_member, name: "static_decl_templ_var"
 
 int C::a = 4;
-// CHECK: [[B]] = distinct !DIGlobalVariable(name: "b", {{.*}} declaration: ![[DECL_B:[0-9]+]])
+// CHECK: [[B]] = !DIGlobalVariableExpression(var: [[BV:.*]])
+// CHECK: [[BV]] = distinct !DIGlobalVariable(name: "b",
+// CHECK-SAME:                                declaration: ![[DECL_B:[0-9]+]])
 // CHECK: ![[DECL_B]] = !DIDerivedType(tag: DW_TAG_member, name: "b"
 // CHECK-NOT:                                 size:
 // CHECK-NOT:                                 align:
@@ -89,7 +93,8 @@ int C::a = 4;
 // CHECK-SAME:           flags: DIFlagPublic | DIFlagStaticMember)
 
 int C::b = 2;
-// CHECK: [[C]] = distinct !DIGlobalVariable(name: "c", {{.*}} declaration: ![[DECL_C]])
+// CHECK: [[C]] = !DIGlobalVariableExpression(var: [[CV:.*]])
+// CHECK: [[CV]] = distinct !DIGlobalVariable(name: "c", {{.*}} declaration: ![[DECL_C]])
 int C::c = 1;
 
 int main()

Modified: cfe/trunk/test/CodeGenCXX/debug-info-template-member.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-template-member.cpp?rev=290155&r1=290154&r2=290155&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-template-member.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-info-template-member.cpp Mon Dec 19 20:10:02 2016
@@ -19,8 +19,9 @@ inline int add3(int x) {
 }
 
 // The compile unit pulls in the global variables first.
-// CHECK: [[X]] = distinct !DIGlobalVariable(name: "x",
-// CHECK-SAME:              type: ![[OUTER_FOO_INNER_ID:[0-9]+]]
+// CHECK: [[X]] = !DIGlobalVariableExpression(var: [[XV:.*]])
+// CHECK: [[XV]] = distinct !DIGlobalVariable(name: "x",
+// CHECK-SAME:                                type: ![[OUTER_FOO_INNER_ID:[0-9]+]]
 
 // CHECK: ![[OUTER_FOO_INNER_ID:[0-9]*]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "inner"{{.*}}, identifier:
 // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "foo"

Modified: cfe/trunk/test/CodeGenCXX/debug-info-template.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-template.cpp?rev=290155&r1=290154&r2=290155&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-template.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-info-template.cpp Mon Dec 19 20:10:02 2016
@@ -25,8 +25,9 @@ struct TC {
 int glb;
 void func();
 
-// CHECK: [[TCI]] = distinct !DIGlobalVariable(name: "tci",
-// CHECK-SAME:              type: ![[TCNESTED:[0-9]+]]
+// CHECK: [[TCI]] = !DIGlobalVariableExpression(var: [[TCIV:.*]])
+// CHECK: [[TCIV]] = distinct !DIGlobalVariable(name: "tci",
+// CHECK-SAME:                                  type: ![[TCNESTED:[0-9]+]]
 // CHECK: ![[TCNESTED]] ={{.*}}!DICompositeType(tag: DW_TAG_structure_type, name: "nested",
 // CHECK-SAME:             scope: ![[TC:[0-9]+]],
 
@@ -83,8 +84,9 @@ TC
 // CHECK: [[TCARG7_3]] = !DITemplateValueParameter(type: [[INT]], value: i32 3)
   3>::nested tci;
 
-// CHECK: [[TCN]] = distinct !DIGlobalVariable(name: "tcn"
-// CHECK-SAME:              type: ![[TCNT:[0-9]+]]
+// CHECK: [[TCN]] = !DIGlobalVariableExpression(var: [[TCNV:.*]])
+// CHECK: [[TCNV]] = distinct !DIGlobalVariable(name: "tcn"
+// CHECK-SAME:                                  type: ![[TCNT:[0-9]+]]
 TC
 // CHECK: ![[TCNT]] ={{.*}}!DICompositeType(tag: DW_TAG_structure_type, name: "TC<int, -3, nullptr, nullptr, nullptr, nullptr>"
 // CHECK-SAME:             templateParams: [[TCNARGS:![0-9]*]]
@@ -123,8 +125,9 @@ template <template <typename> class tmpl
 struct NN {
 };
 
-// CHECK: [[NN]] = distinct !DIGlobalVariable(name: "nn"
-// CHECK-SAME:              type: ![[NNT:[0-9]+]]
+// CHECK: [[NN]] = !DIGlobalVariableExpression(var: [[NNV:.*]])
+// CHECK: [[NNV]] = distinct !DIGlobalVariable(name: "nn"
+// CHECK-SAME:                                 type: ![[NNT:[0-9]+]]
 
 // FIXME: these parameters should probably be rendered as 'glb' rather than
 // '&glb', since they're references, not pointers.

Modified: cfe/trunk/test/CodeGenCXX/debug-info.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info.cpp?rev=290155&r1=290154&r2=290155&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-info.cpp Mon Dec 19 20:10:02 2016
@@ -8,8 +8,9 @@
 
 // !llvm.dbg.cu pulls in globals and their types first.
 // CHECK-NOT: !DIGlobalVariable(name: "c"
-// CHECK: [[X]] = distinct !DIGlobalVariable(name: "x", linkageName: "_ZN6pr96081xE"
-// CHECK-SAME:              type: [[INCARRAYPTR:![0-9]*]]
+// CHECK: [[X]] = !DIGlobalVariableExpression(var: [[XV:!.*]])
+// CHECK: [[XV]] = distinct !DIGlobalVariable(name: "x", linkageName: "_ZN6pr96081xE"
+// CHECK-SAME:                                type: [[INCARRAYPTR:![0-9]*]]
 // CHECK: [[INCARRAYPTR]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: [[INCARRAY:![0-9]+]]
 // CHECK: [[INCARRAY]] = !DICompositeType(tag: DW_TAG_array_type
 // CHECK-NOT:                             line:

Modified: cfe/trunk/test/CodeGenCXX/inline-dllexport-member.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/inline-dllexport-member.cpp?rev=290155&r1=290154&r2=290155&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/inline-dllexport-member.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/inline-dllexport-member.cpp Mon Dec 19 20:10:02 2016
@@ -7,6 +7,7 @@ struct __declspec(dllexport) s {
   static const unsigned int ui = 0;
 };
 
-// CHECK: [[UI]] = distinct !DIGlobalVariable(name: "ui", linkageName: "\01?ui at s@@2IB", scope: ![[SCOPE:[0-9]+]],
+// CHECK: [[UI]] = !DIGlobalVariableExpression(var: [[UIV:.*]])
+// CHECK: [[UIV]] = distinct !DIGlobalVariable(name: "ui", linkageName: "\01?ui at s@@2IB", scope: ![[SCOPE:[0-9]+]],
 // CHECK: ![[SCOPE]] = distinct !DICompileUnit(
 




More information about the cfe-commits mailing list