[cfe-commits] r55231 - in /cfe/trunk: Driver/clang.cpp include/clang/Basic/TargetInfo.h lib/Basic/Targets.cpp
Daniel Dunbar
daniel at zuster.org
Sat Aug 23 01:43:40 PDT 2008
Author: ddunbar
Date: Sat Aug 23 03:43:39 2008
New Revision: 55231
URL: http://llvm.org/viewvc/llvm-project?rev=55231&view=rev
Log:
Add TargetInfo::useNeXTRuntimeAsDefault
- Used to autoselect runtime when neither -fnext-runtime nor
-fgnu-runtime is specified.
- Default impl is false, all darwin targets set it to true.
Modified:
cfe/trunk/Driver/clang.cpp
cfe/trunk/include/clang/Basic/TargetInfo.h
cfe/trunk/lib/Basic/Targets.cpp
Modified: cfe/trunk/Driver/clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/clang.cpp?rev=55231&r1=55230&r2=55231&view=diff
==============================================================================
--- cfe/trunk/Driver/clang.cpp (original)
+++ cfe/trunk/Driver/clang.cpp Sat Aug 23 03:43:39 2008
@@ -387,7 +387,8 @@
// -trigraphs
// -fdollars-in-identifiers
// -fpascal-strings
-static void InitializeLanguageStandard(LangOptions &Options, LangKind LK) {
+static void InitializeLanguageStandard(LangOptions &Options, LangKind LK,
+ TargetInfo *Target) {
if (LangStd == lang_unspecified) {
// Based on the base language, pick one.
switch (LK) {
@@ -454,8 +455,7 @@
} else if (GNURuntime) {
Options.NeXTRuntime = 0;
} else {
- // FIXME: Should autoselect based on platform.
- Options.NeXTRuntime = 0;
+ Options.NeXTRuntime = Target->useNeXTRuntimeAsDefault();
}
}
@@ -1201,7 +1201,7 @@
InitializeBaseLanguage();
LangKind LK = GetLanguage(InFile);
InitializeLangOptions(LangInfo, LK);
- InitializeLanguageStandard(LangInfo, LK);
+ InitializeLanguageStandard(LangInfo, LK, Target.get());
InitializeGCMode(LangInfo);
// Process the -I options and set them in the HeaderInfo.
Modified: cfe/trunk/include/clang/Basic/TargetInfo.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TargetInfo.h?rev=55231&r1=55230&r2=55231&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/TargetInfo.h (original)
+++ cfe/trunk/include/clang/Basic/TargetInfo.h Sat Aug 23 03:43:39 2008
@@ -206,8 +206,10 @@
const char * const Register;
};
- virtual bool useGlobalsForAutomaticVariables() const {return false;}
-
+ virtual bool useGlobalsForAutomaticVariables() const { return false; }
+
+ virtual bool useNeXTRuntimeAsDefault() const { return false; }
+
protected:
virtual void getGCCRegNames(const char * const *&Names,
unsigned &NumNames) const = 0;
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=55231&r1=55230&r2=55231&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Sat Aug 23 03:43:39 2008
@@ -501,6 +501,8 @@
PPC32TargetInfo::getTargetDefines(Defines);
getDarwinDefines(Defines);
}
+
+ virtual bool useNeXTRuntimeAsDefault() const { return true; }
};
} // end anonymous namespace.
@@ -512,6 +514,8 @@
PPC64TargetInfo::getTargetDefines(Defines);
getDarwinDefines(Defines);
}
+
+ virtual bool useNeXTRuntimeAsDefault() const { return true; }
};
} // end anonymous namespace.
@@ -656,6 +660,7 @@
X86_32TargetInfo::getTargetDefines(Defines);
getDarwinDefines(Defines);
}
+ virtual bool useNeXTRuntimeAsDefault() const { return true; }
};
} // end anonymous namespace
@@ -735,6 +740,8 @@
X86_64TargetInfo::getTargetDefines(Defines);
getDarwinDefines(Defines);
}
+
+ virtual bool useNeXTRuntimeAsDefault() const { return true; }
};
} // end anonymous namespace.
More information about the cfe-commits
mailing list