]> granicus.if.org Git - clang/commitdiff
Add wchar_t type to ASTContext. Will be needed for wide strings, since
authorEli Friedman <eli.friedman@gmail.com>
Tue, 12 Feb 2008 08:29:21 +0000 (08:29 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Tue, 12 Feb 2008 08:29:21 +0000 (08:29 +0000)
they are of type wchar_t[].

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47004 91177308-0d34-0410-b5e6-96231b3b80d8

AST/ASTContext.cpp
include/clang/AST/ASTContext.h

index dd8a9d4ecf3cfc4c99c537423394b80a841728bc..c00779c171be27ec165c75bab9bb8b2e8fb123e3 100644 (file)
@@ -839,6 +839,15 @@ QualType ASTContext::getSizeType() const {
   return UnsignedLongTy; 
 }
 
+/// 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 {
+  // On Darwin, wchar_t is defined as a "int". 
+  // FIXME: should derive from "Target".
+  return IntTy; 
+}
+
 /// getPointerDiffType - Return the unique type for "ptrdiff_t" (ref?)
 /// defined in <stddef.h>. Pointer - pointer requires this (C99 6.5.6p9).
 QualType ASTContext::getPointerDiffType() const {
index 3cb2d6589322ecc07ad1eec0067a1878666a1c11..af73643a020cd950ff48265c8ff2758b45cee6b7 100644 (file)
@@ -195,6 +195,10 @@ public:
   /// getSizeType - Return the unique type for "size_t" (C99 7.17), defined
   /// in <stddef.h>. The sizeof operator requires this (C99 6.5.3.4p4).
   QualType getSizeType() const;
+
+  /// getWcharType - Return the unique type for "wchar_t" (C99 7.17), defined
+  /// in <stddef.h>. Wide strings require this (C99 6.4.5p5).
+  QualType getWcharType() const;
   
   /// getPointerDiffType - Return the unique type for "ptrdiff_t" (ref?)
   /// defined in <stddef.h>. Pointer - pointer requires this (C99 6.5.6p9).