Эх сурвалжийг харах

[AST] Type::isVoidType() is trivial and should be inlined.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152364 91177308-0d34-0410-b5e6-96231b3b80d8
Daniel Dunbar 13 жил өмнө
parent
commit
cd485926f1

+ 6 - 0
include/clang/AST/Type.h

@@ -4816,6 +4816,12 @@ inline bool Type::isNonOverloadPlaceholderType() const {
   return false;
   return false;
 }
 }
 
 
+inline bool Type::isVoidType() const {
+  if (const BuiltinType *BT = dyn_cast<BuiltinType>(CanonicalType))
+    return BT->getKind() == BuiltinType::Void;
+  return false;
+}
+
 inline bool Type::isHalfType() const {
 inline bool Type::isHalfType() const {
   if (const BuiltinType *BT = dyn_cast<BuiltinType>(CanonicalType))
   if (const BuiltinType *BT = dyn_cast<BuiltinType>(CanonicalType))
     return BT->getKind() == BuiltinType::Half;
     return BT->getKind() == BuiltinType::Half;

+ 0 - 7
lib/AST/Type.cpp

@@ -309,13 +309,6 @@ const Type *Type::getUnqualifiedDesugaredType() const {
   }
   }
 }
 }
 
 
-/// isVoidType - Helper method to determine if this is the 'void' type.
-bool Type::isVoidType() const {
-  if (const BuiltinType *BT = dyn_cast<BuiltinType>(CanonicalType))
-    return BT->getKind() == BuiltinType::Void;
-  return false;
-}
-
 bool Type::isDerivedType() const {
 bool Type::isDerivedType() const {
   switch (CanonicalType->getTypeClass()) {
   switch (CanonicalType->getTypeClass()) {
   case Pointer:
   case Pointer: