[cfe-commits] r93763 - in /cfe/trunk: include/clang/AST/TypeLoc.h lib/AST/TypeLoc.cpp
Douglas Gregor
dgregor at apple.com
Mon Jan 18 12:37:56 PST 2010
Author: dgregor
Date: Mon Jan 18 14:37:56 2010
New Revision: 93763
URL: http://llvm.org/viewvc/llvm-project?rev=93763&view=rev
Log:
float, double, and long double do need extra data in the
BuiltinTypeLoc structure. Thanks, Enea!
Modified:
cfe/trunk/include/clang/AST/TypeLoc.h
cfe/trunk/lib/AST/TypeLoc.cpp
Modified: cfe/trunk/include/clang/AST/TypeLoc.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/TypeLoc.h?rev=93763&r1=93762&r2=93763&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/TypeLoc.h (original)
+++ cfe/trunk/include/clang/AST/TypeLoc.h Mon Jan 18 14:37:56 2010
@@ -404,7 +404,7 @@
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;
}
Modified: cfe/trunk/lib/AST/TypeLoc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/TypeLoc.cpp?rev=93763&r1=93762&r2=93763&view=diff
==============================================================================
--- cfe/trunk/lib/AST/TypeLoc.cpp (original)
+++ cfe/trunk/lib/AST/TypeLoc.cpp Mon Jan 18 14:37:56 2010
@@ -156,11 +156,6 @@
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 @@
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.
More information about the cfe-commits
mailing list