summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseCXXInlineMethods.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2016-06-16 21:40:06 +0000
committerOlivier Goffart <ogoffart@woboq.com>2016-06-16 21:40:06 +0000
commitf9e890cbf964ec2222693034d159c49a28f6f117 (patch)
treed9b8baadf77a24c92e1ccce8b7905d0a48367ab6 /clang/lib/Parse/ParseCXXInlineMethods.cpp
parent119dad63bc5bd5ed46d2be2556af148264f9f62f (diff)
downloadbcm5719-llvm-f9e890cbf964ec2222693034d159c49a28f6f117.tar.gz
bcm5719-llvm-f9e890cbf964ec2222693034d159c49a28f6f117.zip
Fix a few issues while skipping function bodies
- In functions with try { } catch { }, only the try block would be skipped, not the catch blocks - The template functions would still be parsed. - The initializers within a constructor would still be parsed. - The inline functions within class would still be stored, only to be discared later. - Invalid code with try would assert (as in "int foo() try assert_here") This attempt to do even less while skipping function bodies. Differential Revision: http://reviews.llvm.org/D20821 llvm-svn: 272963
Diffstat (limited to 'clang/lib/Parse/ParseCXXInlineMethods.cpp')
-rw-r--r--clang/lib/Parse/ParseCXXInlineMethods.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseCXXInlineMethods.cpp b/clang/lib/Parse/ParseCXXInlineMethods.cpp
index 3c5134268e8..39fcc827041 100644
--- a/clang/lib/Parse/ParseCXXInlineMethods.cpp
+++ b/clang/lib/Parse/ParseCXXInlineMethods.cpp
@@ -101,6 +101,12 @@ NamedDecl *Parser::ParseCXXInlineMethodDef(AccessSpecifier AS,
return FnD;
}
+ if (SkipFunctionBodies && (!FnD || Actions.canSkipFunctionBody(FnD)) &&
+ trySkippingFunctionBody()) {
+ Actions.ActOnSkippedFunctionBody(FnD);
+ return FnD;
+ }
+
// In delayed template parsing mode, if we are within a class template
// or if we are about to parse function member template then consume
// the tokens and store them for parsing at the end of the translation unit.
OpenPOWER on IntegriCloud