[cfe-commits] r115269 - /cfe/trunk/lib/Analysis/CFG.cpp

Zhongxing Xu xuzhongxing at gmail.com
Thu Sep 30 19:47:11 PDT 2010


Author: zhongxingxu
Date: Thu Sep 30 21:47:11 2010
New Revision: 115269

URL: http://llvm.org/viewvc/llvm-project?rev=115269&view=rev
Log:
The old logic would add non-struct and non C++ struct variables to the local
scope. Now we only add C++ struct with non-trivial destructor variables to the
local scope.

Modified:
    cfe/trunk/lib/Analysis/CFG.cpp

Modified: cfe/trunk/lib/Analysis/CFG.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFG.cpp?rev=115269&r1=115268&r2=115269&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/CFG.cpp (original)
+++ cfe/trunk/lib/Analysis/CFG.cpp Thu Sep 30 21:47:11 2010
@@ -566,13 +566,12 @@
   // Check if type is a C++ class with non-trivial destructor.
   if (const RecordType* RT = QT.getTypePtr()->getAs<RecordType>())
     if (const CXXRecordDecl* CD = dyn_cast<CXXRecordDecl>(RT->getDecl()))
-      if (CD->hasTrivialDestructor())
-        return Scope;
-
-  // Add the variable to scope
-  Scope = createOrReuseLocalScope(Scope);
-  Scope->addVar(VD);
-  ScopePos = Scope->begin();
+      if (!CD->hasTrivialDestructor()) {
+        // Add the variable to scope
+        Scope = createOrReuseLocalScope(Scope);
+        Scope->addVar(VD);
+        ScopePos = Scope->begin();
+      }
   return Scope;
 }
 





More information about the cfe-commits mailing list