aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Type.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2008-09-12 00:47:35 +0000
committerDouglas Gregor <dgregor@apple.com>2008-09-12 00:47:35 +0000
commit77a52233f7c0f162672652051bfe78b65ad4f789 (patch)
tree9b5f558999006b98a47daebc70a2ddad72d05e86 /lib/AST/Type.cpp
parent5e155f0c9bd5916d47a7d99dd8d5b26bdb44d835 (diff)
Give string literals const element typesin C++, and cope with the deprecated C++ conversion from a string literal to a pointer-to-non-const-character
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56137 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Type.cpp')
-rw-r--r--lib/AST/Type.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp
index 41cd828f01..2ecc357d95 100644
--- a/lib/AST/Type.cpp
+++ b/lib/AST/Type.cpp
@@ -498,6 +498,14 @@ bool Type::isCharType() const {
return false;
}
+bool Type::isWideCharType() const {
+ if (const BuiltinType *BT = dyn_cast<BuiltinType>(CanonicalType))
+ return BT->getKind() == BuiltinType::WChar;
+ if (const ASQualType *ASQT = dyn_cast<ASQualType>(CanonicalType))
+ return ASQT->getBaseType()->isWideCharType();
+ return false;
+}
+
/// isSignedIntegerType - Return true if this is an integer type that is
/// signed, according to C99 6.2.5p4 [char, signed char, short, int, long..],
/// an enum decl which has a signed representation, or a vector of signed