Don't forget to reconstruct D after changing the scope that we're
authorEric Christopher <echristo@apple.com>
Thu, 13 Oct 2011 21:43:44 +0000 (21:43 +0000)
committerEric Christopher <echristo@apple.com>
Thu, 13 Oct 2011 21:43:44 +0000 (21:43 +0000)
looking at.

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

lib/CodeGen/LexicalScopes.cpp

index 02fa52527ddf9396a1c6f44ac8487533fe6bc849..a12e1a36d1134909cbf8c043f7dec70e8308329b 100644 (file)
@@ -150,8 +150,10 @@ LexicalScope *LexicalScopes::getOrCreateLexicalScope(DebugLoc DL) {
 /// getOrCreateRegularScope - Find or create a regular lexical scope.
 LexicalScope *LexicalScopes::getOrCreateRegularScope(MDNode *Scope) {
   DIDescriptor D = DIDescriptor(Scope);
-  if (D.isLexicalBlockFile())
+  if (D.isLexicalBlockFile()) {
     Scope = DILexicalBlockFile(Scope).getScope();
+    D = DIDescriptor(Scope);
+  }
  
   LexicalScope *WScope = LexicalScopeMap.lookup(Scope);
   if (WScope)