[cfe-commits] r150020 - /cfe/trunk/lib/AST/RecordLayoutBuilder.cpp

Sean Callanan scallanan at apple.com
Tue Feb 7 16:04:52 PST 2012


Author: spyffe
Date: Tue Feb  7 18:04:52 2012
New Revision: 150020

URL: http://llvm.org/viewvc/llvm-project?rev=150020&view=rev
Log:
If a struct needs to be laid out, and it has not
been completed yet, then complete it if possible.
This fixes some assertion failures encountered by
LLDB.

Modified:
    cfe/trunk/lib/AST/RecordLayoutBuilder.cpp

Modified: cfe/trunk/lib/AST/RecordLayoutBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/RecordLayoutBuilder.cpp?rev=150020&r1=150019&r2=150020&view=diff
==============================================================================
--- cfe/trunk/lib/AST/RecordLayoutBuilder.cpp (original)
+++ cfe/trunk/lib/AST/RecordLayoutBuilder.cpp Tue Feb  7 18:04:52 2012
@@ -2187,6 +2187,10 @@
   // as soon as we begin to parse the definition.  That definition is
   // not a complete definition (which is what isDefinition() tests)
   // until we *finish* parsing the definition.
+
+  if (D->hasExternalLexicalStorage() && !D->getDefinition())
+    getExternalSource()->CompleteType(const_cast<RecordDecl*>(D));
+    
   D = D->getDefinition();
   assert(D && "Cannot get layout of forward declarations!");
   assert(D->isCompleteDefinition() && "Cannot layout type before complete!");





More information about the cfe-commits mailing list