forked from OSchip/llvm-project
Add -target-abi clang-cc option, currently unused.
llvm-svn: 81731
This commit is contained in:
parent
40a90c8754
commit
4e97bc3ee7
|
@ -11,6 +11,7 @@ let Component = "Frontend" in {
|
|||
|
||||
def err_fe_unknown_triple : Error<
|
||||
"unknown target triple '%0', please use -triple or -arch">;
|
||||
def err_fe_unknown_target_abi : Error<"unknown target ABI '%0'">;
|
||||
def err_fe_error_reading : Error<"error reading '%0'">;
|
||||
def err_fe_error_reading_stdin : Error<"error reading stdin">;
|
||||
def err_fe_error_backend : Error<"error in backend: %0">, DefaultFatal;
|
||||
|
|
|
@ -352,6 +352,13 @@ public:
|
|||
llvm::StringMap<bool> &Features) const {
|
||||
}
|
||||
|
||||
/// setABI - Use the specific ABI.
|
||||
///
|
||||
/// \return - False on error (invalid ABI name).
|
||||
virtual bool setABI(const std::string &Name) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/// setFeatureEnabled - Enable or disable a specific target feature,
|
||||
/// the feature name must be valid.
|
||||
///
|
||||
|
|
|
@ -663,6 +663,10 @@ static llvm::cl::opt<bool>
|
|||
NoElideConstructors("fno-elide-constructors",
|
||||
llvm::cl::desc("Disable C++ copy constructor elision"));
|
||||
|
||||
static llvm::cl::opt<std::string>
|
||||
TargetABI("target-abi",
|
||||
llvm::cl::desc("Target a particular ABI type"));
|
||||
|
||||
|
||||
// It might be nice to add bounds to the CommandLine library directly.
|
||||
struct OptLevelParser : public llvm::cl::parser<unsigned> {
|
||||
|
@ -2242,6 +2246,15 @@ int main(int argc, char **argv) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
// Set the target ABI if specified.
|
||||
if (!TargetABI.empty()) {
|
||||
if (!Target->setABI(TargetABI)) {
|
||||
Diags.Report(FullSourceLoc(), diag::err_fe_unknown_target_abi)
|
||||
<< TargetABI;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (!InheritanceViewCls.empty()) // C++ visualization?
|
||||
ProgAction = InheritanceView;
|
||||
|
||||
|
|
Loading…
Reference in New Issue