summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDeclCXX.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-01-26 22:44:13 +0000
committerDouglas Gregor <dgregor@apple.com>2009-01-26 22:44:13 +0000
commitf829825d04b3029a62b470058a12d1186c6eefea (patch)
tree83ab7ae8ca74ab6136231900654a916cce6d4edd /clang/lib/Parse/ParseDeclCXX.cpp
parent9240b3eccb9c2500f596fb491fd848d9c83e1423 (diff)
downloadbcm5719-llvm-f829825d04b3029a62b470058a12d1186c6eefea.tar.gz
bcm5719-llvm-f829825d04b3029a62b470058a12d1186c6eefea.zip
Some micro-optimizations for DISABLE_SMART_POINTERS:
- When it's safe, ActionResult uses the low bit of the pointer for the "invalid" flag rather than a separate "bool" value. This keeps GCC from generating some truly awful code, for a > 3x speedup in the result-passing microbenchmark. - When DISABLE_SMART_POINTERS is defined, store an ActionResult within ASTOwningResult rather than an ASTOwningPtr. Brings the performance benefits of the above to smart pointers with DISABLE_SMART_POINTERS defined. Sadly, these micro-benchmark performance improvements don't seem to make much of a difference on Cocoa.h right now. However, they're harmless and might help with future optimizations. llvm-svn: 63061
Diffstat (limited to 'clang/lib/Parse/ParseDeclCXX.cpp')
-rw-r--r--clang/lib/Parse/ParseDeclCXX.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp
index 26787aec123..1041410f2a4 100644
--- a/clang/lib/Parse/ParseDeclCXX.cpp
+++ b/clang/lib/Parse/ParseDeclCXX.cpp
@@ -393,13 +393,13 @@ void Parser::ParseBaseClause(DeclTy *ClassDecl)
while (true) {
// Parse a base-specifier.
BaseResult Result = ParseBaseSpecifier(ClassDecl);
- if (Result.isInvalid) {
+ if (Result.isInvalid()) {
// Skip the rest of this base specifier, up until the comma or
// opening brace.
SkipUntil(tok::comma, tok::l_brace, true, true);
} else {
// Add this to our array of base specifiers.
- BaseInfo.push_back(Result.Val);
+ BaseInfo.push_back(Result.get());
}
// If the next token is a comma, consume it and keep reading
@@ -835,8 +835,8 @@ void Parser::ParseConstructorInitializer(DeclTy *ConstructorDecl) {
do {
MemInitResult MemInit = ParseMemInitializer(ConstructorDecl);
- if (!MemInit.isInvalid)
- MemInitializers.push_back(MemInit.Val);
+ if (!MemInit.isInvalid())
+ MemInitializers.push_back(MemInit.get());
if (Tok.is(tok::comma))
ConsumeToken();
OpenPOWER on IntegriCloud