summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTWriter.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-02-24 01:12:38 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-02-24 01:12:38 +0000
commitffe055a86feb5a0974d0b077c9b943210f1b9bee (patch)
tree79602afeca37376b7660d2def906d8a917bb5fd0 /clang/lib/Serialization/ASTWriter.cpp
parent3a21e2c33eabb834acf0b58c2d065b4b2a2cbf63 (diff)
downloadbcm5719-llvm-ffe055a86feb5a0974d0b077c9b943210f1b9bee.tar.gz
bcm5719-llvm-ffe055a86feb5a0974d0b077c9b943210f1b9bee.zip
[PCH] When keeping track of top-level decls for "targeted deserialization"
make sure we don't mistake ParmVarDecls for top-level decls. Fixes rdar://10920009. llvm-svn: 151330
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
-rw-r--r--clang/lib/Serialization/ASTWriter.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp
index 8dbd6e44715..66e5d6a625e 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/lib/Serialization/ASTWriter.cpp
@@ -3860,6 +3860,9 @@ void ASTWriter::associateDeclWithFile(const Decl *D, DeclID ID) {
// We only keep track of the file-level declarations of each file.
if (!D->getLexicalDeclContext()->isFileContext())
return;
+ // FIXME: We should never have ParmVarDecls with TU as context.
+ if (isa<ParmVarDecl>(D))
+ return;
SourceManager &SM = Context->getSourceManager();
SourceLocation FileLoc = SM.getFileLoc(Loc);
OpenPOWER on IntegriCloud