diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AST/ASTContext.cpp | 16 |
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 { |