aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-02-26 23:43:47 +0000
committerChris Lattner <sabre@nondot.org>2009-02-26 23:43:47 +0000
commit3a2503227c3db04a3619735127483263c1075ef7 (patch)
tree7780ebca7e1daffe73c7a3651cd546a3b5544f7b /lib
parent220b6369d7717bfe6894b46cef055d3e763827f2 (diff)
make ASTContext::WCharTy a bit more sensical. In C++, it is a disctint type,
but in C99 it is just another int type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65590 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/AST/ASTContext.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index f76d320c38..d059201b5c 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -213,8 +213,10 @@ void ASTContext::InitBuiltinTypes() {
InitBuiltinType(DoubleTy, BuiltinType::Double);
InitBuiltinType(LongDoubleTy, BuiltinType::LongDouble);
- // C++ 3.9.1p5
- InitBuiltinType(WCharTy, BuiltinType::WChar);
+ if (LangOpts.CPlusPlus) // C++ 3.9.1p5
+ InitBuiltinType(WCharTy, BuiltinType::WChar);
+ else // C99
+ WCharTy = getFromTargetType(Target.getWCharType());
// Placeholder type for functions.
InitBuiltinType(OverloadTy, BuiltinType::Overload);
@@ -1437,16 +1439,6 @@ QualType ASTContext::getSizeType() const {
return getFromTargetType(Target.getSizeType());
}
-/// getWCharType - Return the unique type for "wchar_t" (C99 7.17), the
-/// width of characters in wide strings, The value is target dependent and
-/// needs to agree with the definition in <stddef.h>.
-QualType ASTContext::getWCharType() const {
- if (LangOpts.CPlusPlus)
- return WCharTy;
-
- return getFromTargetType(Target.getWCharType());
-}
-
/// getSignedWCharType - Return the type of "signed wchar_t".
/// Used when in C++, as a GCC extension.
QualType ASTContext::getSignedWCharType() const {