define __PASCAL_STRINGS__ whenever -fpascal-strings is enabled.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56824 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp
index 6139f9d..2625da2 100644
--- a/lib/Basic/Targets.cpp
+++ b/lib/Basic/Targets.cpp
@@ -42,10 +42,7 @@
static void getDarwinDefines(std::vector<char> &Defs) {
Define(Defs, "__APPLE__");
Define(Defs, "__MACH__");
- Define(Defs, "__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__=1050");
-
- if (0) // darwin_pascal_strings
- Define(Defs, "__PASCAL_STRINGS__");
+ Define(Defs, "__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__", "1050");
}
static void getDragonFlyDefines(std::vector<char> &Defs) {
diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp
index 3f477c2..458eca6 100644
--- a/lib/Lex/Preprocessor.cpp
+++ b/lib/Lex/Preprocessor.cpp
@@ -414,6 +414,10 @@
if (PP.getLangOptions().ObjC2)
DefineBuiltinMacro(Buf, "OBJC_NEW_PROPERTIES");
+ if (PP.getLangOptions().PascalStrings)
+ DefineBuiltinMacro(Buf, "__PASCAL_STRINGS__");
+
+
// Add __builtin_va_list typedef.
{
const char *VAList = PP.getTargetInfo().getVAListDeclaration();