Merge some calls to FoldingSetNodeID::AddInteger; assuming my measurements aren't completely off, roughly a 1% speedup on SingleSource/UnitTests/ObjC/trivial-interface.m .
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133968 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp
index 583cb5d..320e807 100644
--- a/lib/AST/Type.cpp
+++ b/lib/AST/Type.cpp
@@ -1586,10 +1586,18 @@
ID.AddPointer(Result.getAsOpaquePtr());
for (unsigned i = 0; i != NumArgs; ++i)
ID.AddPointer(ArgTys[i].getAsOpaquePtr());
- ID.AddBoolean(epi.Variadic);
- ID.AddInteger(epi.TypeQuals);
- ID.AddInteger(epi.RefQualifier);
- ID.AddInteger(epi.ExceptionSpecType);
+ // This method is relatively performance sensitive, so as a performance
+ // shortcut, use one AddInteger call instead of four for the next four
+ // fields.
+ assert(!(unsigned(epi.Variadic) & ~1) &&
+ !(unsigned(epi.TypeQuals) & ~255) &&
+ !(unsigned(epi.RefQualifier) & ~3) &&
+ !(unsigned(epi.ExceptionSpecType) & ~7) &&
+ "Values larger than expected.");
+ ID.AddInteger(unsigned(epi.Variadic) +
+ (epi.TypeQuals << 1) +
+ (epi.RefQualifier << 9) +
+ (epi.ExceptionSpecType << 11));
if (epi.ExceptionSpecType == EST_Dynamic) {
for (unsigned i = 0; i != epi.NumExceptions; ++i)
ID.AddPointer(epi.Exceptions[i].getAsOpaquePtr());
diff --git a/tools/driver/Makefile b/tools/driver/Makefile
index 1ba8bc2..00fb350 100644
--- a/tools/driver/Makefile
+++ b/tools/driver/Makefile
@@ -9,13 +9,7 @@
CLANG_LEVEL := ../..
TOOLNAME = clang
-ifndef CLANG_IS_PRODUCTION
TOOLALIAS = clang++
-else
- ifdef CLANGXX_IS_PRODUCTION
- TOOLALIAS = clang++
- endif
-endif
# We don't currently expect production Clang builds to be interested in
# plugins. This is important for startup performance.
@@ -72,7 +66,5 @@
# Translate make variable to define when building a "production" clang.
ifdef CLANG_IS_PRODUCTION
CPP.Defines += -DCLANG_IS_PRODUCTION
-endif
-ifdef CLANGXX_IS_PRODUCTION
CPP.Defines += -DCLANGXX_IS_PRODUCTION
endif