]> granicus.if.org Git - clang/commitdiff
Replace two QualType::getTypePtrOrNull() calls with
authorDouglas Gregor <dgregor@apple.com>
Fri, 10 Dec 2010 17:19:40 +0000 (17:19 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 10 Dec 2010 17:19:40 +0000 (17:19 +0000)
QualType::getTypePtr(). It turns out that
cast_or_null/dyn_cast_or_null don't actually use simplify_type, so
they're guaranteed to operator on non-NULL QualType or CanQualType
objects.

Good for a 0.6% win on 403.gcc's combine.c with -emit-llvm.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121495 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/CanonicalType.h
include/clang/AST/Type.h

index b1962b7b9e4d8d79890f965bfecfeea3d00ae483..2d67a39f95174321193c988eabc8fba588539f5b 100644 (file)
@@ -347,7 +347,7 @@ template<typename T>
 struct simplify_type<const ::clang::CanQual<T> > {
   typedef T* SimpleType;
   static SimpleType getSimplifiedValue(const ::clang::CanQual<T> &Val) {
-    return Val.getTypePtrOrNull();
+    return Val.getTypePtr();
   }
 };
 template<typename T>
index 5c67dd8b4f8b1c95bbaf78c3b8b0d609a508365f..81230b7a54af91784ef715b1bbd8e59504645e71 100644 (file)
@@ -771,7 +771,7 @@ namespace llvm {
 template<> struct simplify_type<const ::clang::QualType> {
   typedef ::clang::Type* SimpleType;
   static SimpleType getSimplifiedValue(const ::clang::QualType &Val) {
-    return Val.getTypePtrOrNull();
+    return Val.getTypePtr();
   }
 };
 template<> struct simplify_type< ::clang::QualType>