[cfe-commits] r73050 - in /cfe/trunk: include/clang/Basic/TokenKinds.def lib/Basic/Targets.cpp lib/Frontend/InitPreprocessor.cpp tools/clang-cc/clang-cc.cpp
Eli Friedman
eli.friedman at gmail.com
Sun Jun 7 23:11:14 PDT 2009
Author: efriedma
Date: Mon Jun 8 01:11:14 2009
New Revision: 73050
URL: http://llvm.org/viewvc/llvm-project?rev=73050&view=rev
Log:
Misc minor fixes for clang for the Windows target.
Modified:
cfe/trunk/include/clang/Basic/TokenKinds.def
cfe/trunk/lib/Basic/Targets.cpp
cfe/trunk/lib/Frontend/InitPreprocessor.cpp
cfe/trunk/tools/clang-cc/clang-cc.cpp
Modified: cfe/trunk/include/clang/Basic/TokenKinds.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TokenKinds.def?rev=73050&r1=73049&r2=73050&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/TokenKinds.def (original)
+++ cfe/trunk/include/clang/Basic/TokenKinds.def Mon Jun 8 01:11:14 2009
@@ -341,7 +341,6 @@
ALIAS("__const" , const , KEYALL)
ALIAS("__const__" , const , KEYALL)
ALIAS("__alignof__" , __alignof , KEYALL)
-ALIAS("_asm" , asm , KEYMS)
ALIAS("__asm" , asm , KEYALL)
ALIAS("__asm__" , asm , KEYALL)
ALIAS("__complex" , _Complex , KEYALL)
@@ -359,6 +358,11 @@
ALIAS("__volatile" , volatile , KEYALL)
ALIAS("__volatile__" , volatile , KEYALL)
+// Microsoft extensions which should be disabled in strict conformance mode
+ALIAS("_asm" , asm , KEYMS)
+ALIAS("_cdecl" , __cdecl , KEYMS)
+ALIAS("_fastcall" , __fastcall , KEYMS)
+ALIAS("_stdcall" , __stdcall , KEYMS)
//===----------------------------------------------------------------------===//
// Objective-C @-preceeded keywords.
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=73050&r1=73049&r2=73050&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Mon Jun 8 01:11:14 2009
@@ -244,6 +244,11 @@
Opts.ObjCNonFragileABI = 1;
}
+/// GetWindowsLanguageOptions - Set the default language options for Windows.
+static void GetWindowsLanguageOptions(LangOptions &Opts,
+ const char *Triple) {
+ Opts.Microsoft = true;
+}
//===----------------------------------------------------------------------===//
// Specific target implementations.
@@ -924,9 +929,8 @@
WindowsX86_32TargetInfo(const std::string& triple)
: X86_32TargetInfo(triple) {
TLSSupported = false;
- // FIXME: Fix wchar_t.
- // FIXME: We should probably enable -fms-extensions by default for
- // this target.
+ WCharType = SignedShort;
+ WCharWidth = WCharAlign = 16;
}
virtual void getTargetDefines(const LangOptions &Opts,
std::vector<char> &Defines) const {
@@ -938,6 +942,11 @@
Define(Defines, "_X86_");
Define(Defines, "__MSVCRT__");
}
+
+ virtual void getDefaultLangOptions(LangOptions &Opts) {
+ X86_32TargetInfo::getDefaultLangOptions(Opts);
+ GetWindowsLanguageOptions(Opts, getTargetTriple());
+ }
};
} // end anonymous namespace
Modified: cfe/trunk/lib/Frontend/InitPreprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitPreprocessor.cpp?rev=73050&r1=73049&r2=73050&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/InitPreprocessor.cpp (original)
+++ cfe/trunk/lib/Frontend/InitPreprocessor.cpp Mon Jun 8 01:11:14 2009
@@ -310,7 +310,6 @@
// Filter out some microsoft extensions when trying to parse in ms-compat
// mode.
if (LangOpts.Microsoft) {
- DefineBuiltinMacro(Buf, "_cdecl=__cdecl");
DefineBuiltinMacro(Buf, "__int8=__INT8_TYPE__");
DefineBuiltinMacro(Buf, "__int16=__INT16_TYPE__");
DefineBuiltinMacro(Buf, "__int32=__INT32_TYPE__");
Modified: cfe/trunk/tools/clang-cc/clang-cc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/clang-cc.cpp?rev=73050&r1=73049&r2=73050&view=diff
==============================================================================
--- cfe/trunk/tools/clang-cc/clang-cc.cpp (original)
+++ cfe/trunk/tools/clang-cc/clang-cc.cpp Mon Jun 8 01:11:14 2009
@@ -808,7 +808,8 @@
if (PascalStrings.getPosition())
Options.PascalStrings = PascalStrings;
- Options.Microsoft = MSExtensions;
+ if (MSExtensions.getPosition())
+ Options.Microsoft = MSExtensions;
Options.WritableStrings = WritableStrings;
if (NoLaxVectorConversions.getPosition())
Options.LaxVectorConversions = 0;
More information about the cfe-commits
mailing list