[PATCH] [clang] Optimized ASTNodeKind::isBaseOf

Manuel Klimek klimek at google.com
Thu Oct 2 05:00:31 PDT 2014


================
Comment at: lib/AST/ASTTypeTraits.cpp:51
@@ +50,3 @@
+           Parent = ASTNodeKind::AllKindInfo[Parent].ParentId)
+        ParentDistances[Node][Parent] = Distance++;
+    }
----------------
For my sanity: please one side-effect per line.

================
Comment at: lib/AST/ASTTypeTraits.cpp:64
@@ -44,1 +63,3 @@
+  static const NodeParentMap *Map = new NodeParentMap;
+  return (Distance = Map->ParentDistances[Other.KindId][KindId]) != -1U;
 }
----------------
For my sanity: please one side-effect per line.

http://reviews.llvm.org/D5577






More information about the cfe-commits mailing list