When building a PCH file, don't perform end-of-translation-unit
wrap-up (e.g., turning tentative definitions into definitions). Also,
very that, when we actually use the PCH file, we get the ride code
generation for tentative definitions and definitions that show up in
the PCH file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69043 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/clang-cc/clang-cc.cpp b/tools/clang-cc/clang-cc.cpp
index 91b87f2..3360649 100644
--- a/tools/clang-cc/clang-cc.cpp
+++ b/tools/clang-cc/clang-cc.cpp
@@ -1912,6 +1912,7 @@
llvm::OwningPtr<ASTConsumer> Consumer;
bool ClearSourceMgr = false;
FixItRewriter *FixItRewrite = 0;
+ bool CompleteTranslationUnit = true;
switch (PA) {
default:
@@ -1925,6 +1926,8 @@
return;
}
+ if (ProgAction == GeneratePCH)
+ CompleteTranslationUnit = false;
break;
case DumpRawTokens: {
@@ -2098,7 +2101,8 @@
return;
}
- ParseAST(PP, Consumer.get(), *ContextOwner.get(), Stats);
+ ParseAST(PP, Consumer.get(), *ContextOwner.get(), Stats,
+ CompleteTranslationUnit);
if (FixItRewrite)
FixItRewrite->WriteFixedFile(InFile, OutputFile);