diff options
Diffstat (limited to 'lldb/scripts/clang.require-complete-type.diff')
| -rw-r--r-- | lldb/scripts/clang.require-complete-type.diff | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/lldb/scripts/clang.require-complete-type.diff b/lldb/scripts/clang.require-complete-type.diff new file mode 100644 index 00000000000..9e52947eebb --- /dev/null +++ b/lldb/scripts/clang.require-complete-type.diff @@ -0,0 +1,75 @@ +Index: lib/Sema/SemaType.cpp +=================================================================== +--- lib/Sema/SemaType.cpp (revision 144982) ++++ lib/Sema/SemaType.cpp (working copy) +@@ -4065,6 +4065,34 @@ + if (!T->isIncompleteType()) + return false; + ++ const TagType *Tag = T->getAs<TagType>(); ++ const ObjCInterfaceType *IFace = 0; ++ ++ if (Tag) { ++ // Avoid diagnosing invalid decls as incomplete. ++ if (Tag->getDecl()->isInvalidDecl()) ++ return true; ++ ++ // Give the external AST source a chance to complete the type. ++ if (Tag->getDecl()->hasExternalLexicalStorage()) { ++ Context.getExternalSource()->CompleteType(Tag->getDecl()); ++ if (!Tag->isIncompleteType()) ++ return false; ++ } ++ } ++ else if ((IFace = T->getAs<ObjCInterfaceType>())) { ++ // Avoid diagnosing invalid decls as incomplete. ++ if (IFace->getDecl()->isInvalidDecl()) ++ return true; ++ ++ // Give the external AST source a chance to complete the type. ++ if (IFace->getDecl()->hasExternalLexicalStorage()) { ++ Context.getExternalSource()->CompleteType(IFace->getDecl()); ++ if (!IFace->isIncompleteType()) ++ return false; ++ } ++ } ++ + // If we have a class template specialization or a class member of a + // class template specialization, or an array with known size of such, + // try to instantiate it. +@@ -4096,35 +4124,7 @@ + + if (diag == 0) + return true; +- +- const TagType *Tag = T->getAs<TagType>(); +- const ObjCInterfaceType *IFace = 0; +- +- if (Tag) { +- // Avoid diagnosing invalid decls as incomplete. +- if (Tag->getDecl()->isInvalidDecl()) +- return true; +- +- // Give the external AST source a chance to complete the type. +- if (Tag->getDecl()->hasExternalLexicalStorage()) { +- Context.getExternalSource()->CompleteType(Tag->getDecl()); +- if (!Tag->isIncompleteType()) +- return false; +- } +- } +- else if ((IFace = T->getAs<ObjCInterfaceType>())) { +- // Avoid diagnosing invalid decls as incomplete. +- if (IFace->getDecl()->isInvalidDecl()) +- return true; + +- // Give the external AST source a chance to complete the type. +- if (IFace->getDecl()->hasExternalLexicalStorage()) { +- Context.getExternalSource()->CompleteType(IFace->getDecl()); +- if (!IFace->isIncompleteType()) +- return false; +- } +- } +- + // We have an incomplete type. Produce a diagnostic. + Diag(Loc, PD) << T; + |

