summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTDumper.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-01-24 01:07:20 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-01-24 01:07:20 +0000
commit8a63989728b67584e64800e1f4c586f8c0acbfa7 (patch)
treebbff117d868c80a4ba00d6ecf8ede1ade84e6cba /clang/lib/AST/ASTDumper.cpp
parentad363ad8042f44e8006554a6447fc46807d1a9ed (diff)
downloadbcm5719-llvm-8a63989728b67584e64800e1f4c586f8c0acbfa7.tar.gz
bcm5719-llvm-8a63989728b67584e64800e1f4c586f8c0acbfa7.zip
[modules] Sometimes we can deserialize a class member but not have yet
encountered any definition for the class; this happens when the definition is added by an update record that is not yet loaded. In such a case, eagerly pick the original parent of the member as the canonical definition of the class rather than muddling through with the canonical declaration (the latter can lead to us failing to merge properly later if the canonical definition turns out to be some other declaration). llvm-svn: 226977
Diffstat (limited to 'clang/lib/AST/ASTDumper.cpp')
-rw-r--r--clang/lib/AST/ASTDumper.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/clang/lib/AST/ASTDumper.cpp b/clang/lib/AST/ASTDumper.cpp
index ebf5e651ef9..edd836041fc 100644
--- a/clang/lib/AST/ASTDumper.cpp
+++ b/clang/lib/AST/ASTDumper.cpp
@@ -1099,10 +1099,13 @@ void ASTDumper::VisitFunctionDecl(const FunctionDecl *D) {
E = D->getDeclsInPrototypeScope().end(); I != E; ++I)
dumpDecl(*I);
- for (FunctionDecl::param_const_iterator I = D->param_begin(),
- E = D->param_end();
- I != E; ++I)
- dumpDecl(*I);
+ if (!D->param_begin() && D->getNumParams())
+ dumpChild([=] { OS << "<<NULL params x " << D->getNumParams() << ">>"; });
+ else
+ for (FunctionDecl::param_const_iterator I = D->param_begin(),
+ E = D->param_end();
+ I != E; ++I)
+ dumpDecl(*I);
if (const CXXConstructorDecl *C = dyn_cast<CXXConstructorDecl>(D))
for (CXXConstructorDecl::init_const_iterator I = C->init_begin(),
OpenPOWER on IntegriCloud