diff options
author | Charles Davis <cdavis@mines.edu> | 2010-06-11 01:06:47 +0000 |
---|---|---|
committer | Charles Davis <cdavis@mines.edu> | 2010-06-11 01:06:47 +0000 |
commit | 98b7c5c496dfccb39287b8f7d8f1444594936d10 (patch) | |
tree | 5b57495e053746c8c6b904d93dc90ad8bee71a7a /include/clang/Basic | |
parent | 6c321e35008f2c99eeb1409b43859a04c48e5ce5 (diff) |
Add an option to specify the target C++ ABI to the frontend. Use it to
select either the default Itanium ABI or the new, experimental Microsoft ABI.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105804 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic')
-rw-r--r-- | include/clang/Basic/DiagnosticCommonKinds.td | 1 | ||||
-rw-r--r-- | include/clang/Basic/TargetInfo.h | 16 | ||||
-rw-r--r-- | include/clang/Basic/TargetOptions.h | 4 |
3 files changed, 21 insertions, 0 deletions
diff --git a/include/clang/Basic/DiagnosticCommonKinds.td b/include/clang/Basic/DiagnosticCommonKinds.td index 88e7dc19ae..4b0bf57bef 100644 --- a/include/clang/Basic/DiagnosticCommonKinds.td +++ b/include/clang/Basic/DiagnosticCommonKinds.td @@ -66,6 +66,7 @@ def err_target_unknown_triple : Error< "unknown target triple '%0', please use -triple or -arch">; def err_target_unknown_cpu : Error<"unknown target CPU '%0'">; def err_target_unknown_abi : Error<"unknown target ABI '%0'">; +def err_target_unknown_cxxabi : Error<"unknown C++ ABI '%0'">; def err_target_invalid_feature : Error<"invalid target feature '%0'">; // Source manager diff --git a/include/clang/Basic/TargetInfo.h b/include/clang/Basic/TargetInfo.h index 4c5019ca98..5763a12135 100644 --- a/include/clang/Basic/TargetInfo.h +++ b/include/clang/Basic/TargetInfo.h @@ -58,6 +58,7 @@ protected: const char *UserLabelPrefix; const llvm::fltSemantics *FloatFormat, *DoubleFormat, *LongDoubleFormat; unsigned char RegParmMax, SSERegParmMax; + std::string CXXABI; unsigned HasAlignMac68kSupport : 1; @@ -396,6 +397,11 @@ public: return ""; } + /// getCXXABI - Get the C++ ABI in use. + virtual llvm::StringRef getCXXABI() const { + return CXXABI; + } + /// setCPU - Target the specific CPU. /// /// \return - False on error (invalid CPU name). @@ -412,6 +418,16 @@ public: return false; } + /// setCXXABI - Use this specific C++ ABI. + /// + /// \return - False on error (invalid ABI name). + virtual bool setCXXABI(const std::string &Name) { + if (Name != "itanium" && Name != "microsoft") + return false; + CXXABI = Name; + return true; + } + /// setFeatureEnabled - Enable or disable a specific target feature, /// the feature name must be valid. /// diff --git a/include/clang/Basic/TargetOptions.h b/include/clang/Basic/TargetOptions.h index eeaab1558f..cec8f53158 100644 --- a/include/clang/Basic/TargetOptions.h +++ b/include/clang/Basic/TargetOptions.h @@ -29,6 +29,10 @@ public: /// If given, the name of the target ABI to use. std::string ABI; + /// If given, the name of the target C++ ABI to use. If not given, defaults + /// to "itanium". + std::string CXXABI; + /// The list of target specific features to enable or disable -- this should /// be a list of strings starting with by '+' or '-'. std::vector<std::string> Features; |