diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-09-17 03:06:44 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-09-17 03:06:44 +0000 |
commit | 865c2a7f23de81681f6948b19cddbd36eabf886a (patch) | |
tree | e18385034eacd9b300c1d2d980de001d80ea980a /clang/lib/Frontend/PCHReaderDecl.cpp | |
parent | ac6271e3f4c8a2afff3abc51d770d8973a22c672 (diff) | |
download | bcm5719-llvm-865c2a7f23de81681f6948b19cddbd36eabf886a.tar.gz bcm5719-llvm-865c2a7f23de81681f6948b19cddbd36eabf886a.zip |
PCH: When deserializing an explicit "external definition", don't pass it to HandleTopLevelDecl -- this is already being done inside the reader.
This is something of a hack, since whether the reader actually did this depends on the "isConsumerInterestedIn" predicate. I think we need to rework how this works, but I need to discuss with Doug.
llvm-svn: 82111
Diffstat (limited to 'clang/lib/Frontend/PCHReaderDecl.cpp')
-rw-r--r-- | clang/lib/Frontend/PCHReaderDecl.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Frontend/PCHReaderDecl.cpp b/clang/lib/Frontend/PCHReaderDecl.cpp index c3c05b0d5da..67ffabba863 100644 --- a/clang/lib/Frontend/PCHReaderDecl.cpp +++ b/clang/lib/Frontend/PCHReaderDecl.cpp @@ -640,6 +640,8 @@ inline void PCHReader::LoadedDecl(unsigned Index, Decl *D) { /// code generation, e.g., inline function definitions, Objective-C /// declarations with metadata, etc. static bool isConsumerInterestedIn(Decl *D) { + if (isa<FileScopeAsmDecl>(D)) + return true; if (VarDecl *Var = dyn_cast<VarDecl>(D)) return Var->isFileVarDecl() && Var->getInit(); if (FunctionDecl *Func = dyn_cast<FunctionDecl>(D)) @@ -794,4 +796,3 @@ Decl *PCHReader::ReadDeclRecord(uint64_t Offset, unsigned Index) { return D; } - |