diff options
author | Hans Wennborg <hans@hanshq.net> | 2013-05-03 09:10:16 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2013-05-03 09:10:16 +0000 |
commit | 6f464bb8d316b95bf60efcdb2d21803659d3aa1b (patch) | |
tree | e4d554844ad553b9d747996604c909adc6666eea /include/clang/AST/PrettyPrinter.h | |
parent | f5ebf9bf1df10ac15ba32a4b24dfe171b7848c58 (diff) |
Support __wchar_t in -fms-extensions and -fms-compatibility modes.
MSVC provides __wchar_t, either as an alias for the built-in wchar_t
type, or as a separate type depending on language (C vs C++) and flags
(-fno-wchar).
In -fms-extensions, Clang will simply accept __wchar_t as an alias for
whatever type is used for wide character literals. In -fms-compatibility, we
try to mimic MSVC's behavior by always making __wchar_t a builtin type.
This fixes PR15815.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181004 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/AST/PrettyPrinter.h')
-rw-r--r-- | include/clang/AST/PrettyPrinter.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/clang/AST/PrettyPrinter.h b/include/clang/AST/PrettyPrinter.h index e3c09e7b41..36e90724d9 100644 --- a/include/clang/AST/PrettyPrinter.h +++ b/include/clang/AST/PrettyPrinter.h @@ -40,7 +40,8 @@ struct PrintingPolicy { SuppressUnwrittenScope(false), SuppressInitializers(false), ConstantArraySizeAsWritten(false), AnonymousTagLocations(true), SuppressStrongLifetime(false), Bool(LO.Bool), - TerseOutput(false), PolishForDeclaration(false) { } + TerseOutput(false), PolishForDeclaration(false), + MSWChar(LO.MicrosoftMode && !LO.WChar) { } /// \brief What language we're printing. LangOptions LangOpts; @@ -146,6 +147,10 @@ struct PrintingPolicy { /// declaration tag; such as, do not print attributes attached to the declaration. /// unsigned PolishForDeclaration : 1; + + /// \brief When true, print the built-in wchar_t type as __wchar_t. For use in + /// Microsoft mode when wchar_t is not available. + unsigned MSWChar : 1; }; } // end namespace clang |