[cfe-commits] r133968 - in /cfe/trunk: lib/AST/Type.cpp tools/driver/Makefile

Eli Friedman eli.friedman at gmail.com
Mon Jun 27 16:58:22 PDT 2011


Author: efriedma
Date: Mon Jun 27 18:58:21 2011
New Revision: 133968

URL: http://llvm.org/viewvc/llvm-project?rev=133968&view=rev
Log:
Merge some calls to FoldingSetNodeID::AddInteger; assuming my measurements aren't completely off, roughly a 1% speedup on SingleSource/UnitTests/ObjC/trivial-interface.m .


Modified:
    cfe/trunk/lib/AST/Type.cpp
    cfe/trunk/tools/driver/Makefile

Modified: cfe/trunk/lib/AST/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Type.cpp?rev=133968&r1=133967&r2=133968&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Type.cpp (original)
+++ cfe/trunk/lib/AST/Type.cpp Mon Jun 27 18:58:21 2011
@@ -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());

Modified: cfe/trunk/tools/driver/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/Makefile?rev=133968&r1=133967&r2=133968&view=diff
==============================================================================
--- cfe/trunk/tools/driver/Makefile (original)
+++ cfe/trunk/tools/driver/Makefile Mon Jun 27 18:58:21 2011
@@ -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





More information about the cfe-commits mailing list