summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-09-04 23:34:21 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-09-04 23:34:21 +0000
commit49a497fa6c4f86695f1e4ceb81f0ac3beb16e167 (patch)
treec63a83c43665ba6e86b78e4cf494ac5fd7a9f137 /clang/lib/AST
parent1df64b081b0b1f4f58d91bbd3f84743024d53598 (diff)
downloadbcm5719-llvm-49a497fa6c4f86695f1e4ceb81f0ac3beb16e167.tar.gz
bcm5719-llvm-49a497fa6c4f86695f1e4ceb81f0ac3beb16e167.zip
PR17103: Scoped enumerations with signed integer types have signed integer
representation. Don't emit comparisons on them as 'icmp ult'! llvm-svn: 190010
Diffstat (limited to 'clang/lib/AST')
-rw-r--r--clang/lib/AST/Type.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp
index b848d3a2247..8027f52216f 100644
--- a/clang/lib/AST/Type.cpp
+++ b/clang/lib/AST/Type.cpp
@@ -738,9 +738,9 @@ bool Type::isSignedIntegerOrEnumerationType() const {
bool Type::hasSignedIntegerRepresentation() const {
if (const VectorType *VT = dyn_cast<VectorType>(CanonicalType))
- return VT->getElementType()->isSignedIntegerType();
+ return VT->getElementType()->isSignedIntegerOrEnumerationType();
else
- return isSignedIntegerType();
+ return isSignedIntegerOrEnumerationType();
}
/// isUnsignedIntegerType - Return true if this is an integer type that is
@@ -778,9 +778,9 @@ bool Type::isUnsignedIntegerOrEnumerationType() const {
bool Type::hasUnsignedIntegerRepresentation() const {
if (const VectorType *VT = dyn_cast<VectorType>(CanonicalType))
- return VT->getElementType()->isUnsignedIntegerType();
+ return VT->getElementType()->isUnsignedIntegerOrEnumerationType();
else
- return isUnsignedIntegerType();
+ return isUnsignedIntegerOrEnumerationType();
}
bool Type::isFloatingType() const {
OpenPOWER on IntegriCloud