-E, -Eonly and -parse-noop now work with PCH!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70259 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp
index 7483f78..7ca0300 100644
--- a/lib/Frontend/PCHReader.cpp
+++ b/lib/Frontend/PCHReader.cpp
@@ -270,6 +270,8 @@
// Read all of the declarations visible at global scope with this
// name.
Sema *SemaObj = Reader.getSema();
+ if (!SemaObj) return II;
+
while (DataLen > 0) {
NamedDecl *D = cast<NamedDecl>(Reader.GetDecl(ReadUnalignedLE32(d)));
if (SemaObj) {