aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Type.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2008-06-28 06:23:08 +0000
committerEli Friedman <eli.friedman@gmail.com>2008-06-28 06:23:08 +0000
commitad74a758189180b8ab8faea648e4766c3bfd7fcb (patch)
tree6203e714f5188e21a8d71fe6cbaf77a4a9e03adc /lib/AST/Type.cpp
parent53d0ea5f5bfa647ec23418bf3a3b7c183b51e4bd (diff)
Fix for PR2501; this patch makes usual arithmetic conversions for
integers which have the same width and different signedness work correctly. (The testcase in PR2501 uses a comparison between long and unsigned int). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52853 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Type.cpp')
-rw-r--r--lib/AST/Type.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp
index 7e09bb1ae3..bf32c5306d 100644
--- a/lib/AST/Type.cpp
+++ b/lib/AST/Type.cpp
@@ -390,6 +390,13 @@ const RecordType *Type::getAsUnionType() const {
return 0;
}
+const EnumType *Type::getAsEnumType() const {
+ // Check the canonicalized unqualified type directly; the more complex
+ // version is unnecessary because there isn't any typedef information
+ // to preserve.
+ return dyn_cast<EnumType>(CanonicalType.getUnqualifiedType());
+}
+
const ComplexType *Type::getAsComplexType() const {
// Are we directly a complex type?
if (const ComplexType *CTy = dyn_cast<ComplexType>(this))