]> granicus.if.org Git - clang/commitdiff
float, double, and long double do need extra data in the
authorDouglas Gregor <dgregor@apple.com>
Mon, 18 Jan 2010 20:37:56 +0000 (20:37 +0000)
committerDouglas Gregor <dgregor@apple.com>
Mon, 18 Jan 2010 20:37:56 +0000 (20:37 +0000)
BuiltinTypeLoc structure. Thanks, Enea!

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

include/clang/AST/TypeLoc.h
lib/AST/TypeLoc.cpp

index 0a40ea1fc47d6df6adfda409a932a3e6df0db644..914cc8d0f095b45dddd895babc544837fcebba7d 100644 (file)
@@ -404,7 +404,7 @@ public:
   bool needsExtraLocalData() const {
     BuiltinType::Kind bk = getTypePtr()->getKind();
     return (bk >= BuiltinType::UShort && bk <= BuiltinType::UInt128)
-      || (bk >= BuiltinType::Short && bk <= BuiltinType::Int128)
+      || (bk >= BuiltinType::Short && bk <= BuiltinType::LongDouble)
       || bk == BuiltinType::UChar
       || bk == BuiltinType::SChar;
   }
index 6da2ab0dee628109d8bd74dd6f34ecb8ba520036..fd9fbc191868a9b24598665fd3c7c71920e12683 100644 (file)
@@ -156,11 +156,6 @@ TypeSpecifierType BuiltinTypeLoc::getWrittenTypeSpec() const {
       return TST_char32;
     case BuiltinType::WChar:
       return TST_wchar;
-    case BuiltinType::Float:
-      return TST_float;
-    case BuiltinType::Double:
-    case BuiltinType::LongDouble:
-      return TST_double;
     case BuiltinType::UndeducedAuto:
       return TST_auto;
         
@@ -176,6 +171,9 @@ TypeSpecifierType BuiltinTypeLoc::getWrittenTypeSpec() const {
     case BuiltinType::Long:
     case BuiltinType::LongLong:
     case BuiltinType::Int128:
+    case BuiltinType::Float:
+    case BuiltinType::Double:
+    case BuiltinType::LongDouble:
       llvm_unreachable("Builtin type needs extra local data!");
       // Fall through, if the impossible happens.