Misc minor fixes for clang for the Windows target.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73050 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eli Friedman 2009-06-08 06:11:14 +00:00
Родитель 3b658d3ecb
Коммит abc4e32603
4 изменённых файлов: 19 добавлений и 6 удалений

Просмотреть файл

@ -341,7 +341,6 @@ ALIAS("__attribute__", __attribute, KEYALL)
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("__typeof__" , typeof , KEYALL)
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.

Просмотреть файл

@ -244,6 +244,11 @@ static void GetDarwinLanguageOptions(LangOptions &Opts,
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 @@ public:
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 @@ public:
Define(Defines, "_X86_");
Define(Defines, "__MSVCRT__");
}
virtual void getDefaultLangOptions(LangOptions &Opts) {
X86_32TargetInfo::getDefaultLangOptions(Opts);
GetWindowsLanguageOptions(Opts, getTargetTriple());
}
};
} // end anonymous namespace

Просмотреть файл

@ -310,7 +310,6 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
// 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__");

Просмотреть файл

@ -808,7 +808,8 @@ static void InitializeLanguageStandard(LangOptions &Options, LangKind LK,
if (PascalStrings.getPosition())
Options.PascalStrings = PascalStrings;
Options.Microsoft = MSExtensions;
if (MSExtensions.getPosition())
Options.Microsoft = MSExtensions;
Options.WritableStrings = WritableStrings;
if (NoLaxVectorConversions.getPosition())
Options.LaxVectorConversions = 0;