summaryrefslogtreecommitdiffstats
path: root/clang/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
commit007cb026c9a4f56302bea0e8e3ff10fdb002b313 (patch)
tree59e0c84996f9478d95b2ee2fcaa04d05655378b4 /clang/lib
parent012b339693986c825a5ba9cc63ce966628756236 (diff)
downloadbcm5719-llvm-007cb026c9a4f56302bea0e8e3ff10fdb002b313.tar.gz
bcm5719-llvm-007cb026c9a4f56302bea0e8e3ff10fdb002b313.zip
make ASTContext::WCharTy a bit more sensical. In C++, it is a disctint type,
but in C99 it is just another int type. llvm-svn: 65590
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/ASTContext.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index f76d320c386..d059201b5cd 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/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 {
OpenPOWER on IntegriCloud