]> granicus.if.org Git - clang/commitdiff
[DebugInfo] Use DbgVariableIntrinsic as the base class of variables.
authorHsiangkai Wang <hsiangkai@gmail.com>
Mon, 6 Aug 2018 04:00:08 +0000 (04:00 +0000)
committerHsiangkai Wang <hsiangkai@gmail.com>
Mon, 6 Aug 2018 04:00:08 +0000 (04:00 +0000)
After refactoring DbgInfoIntrinsic class hierarchy, we use
DbgVariableIntrinsic as the base class of variable debug info.

In resolveTopLevelMetadata() in CGVTables.cpp, we only care about
dbg.value, so we try to cast the instructions to DbgVariableIntrinsic
before resolving variables.

Differential Revision: https://reviews.llvm.org/D50226

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338985 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGVTables.cpp

index cc334637a831054e54b150a2ca2c2ca9fe668c79..d07c160e2418ab516cb88263ca3416f6251594ab 100644 (file)
@@ -128,7 +128,7 @@ static void resolveTopLevelMetadata(llvm::Function *Fn,
   // they are referencing.
   for (auto &BB : Fn->getBasicBlockList()) {
     for (auto &I : BB) {
-      if (auto *DII = dyn_cast<llvm::DbgInfoIntrinsic>(&I)) {
+      if (auto *DII = dyn_cast<llvm::DbgVariableIntrinsic>(&I)) {
         auto *DILocal = DII->getVariable();
         if (!DILocal->isResolved())
           DILocal->resolve();