diff options
author | Scott Egerton <Scott.Egerton@imgtec.com> | 2016-01-14 13:01:48 +0000 |
---|---|---|
committer | Scott Egerton <Scott.Egerton@imgtec.com> | 2016-01-14 13:01:48 +0000 |
commit | b67d4690a897cae50cfe28a7b0401ffb7e729c07 (patch) | |
tree | 44cbc9957f91a797d31f5a4c1e26e3387997b650 /clang/lib/Driver/Tools.cpp | |
parent | f84df99520791bb1397004adb0cd6ca6f659a0b0 (diff) | |
download | llvm-b67d4690a897cae50cfe28a7b0401ffb7e729c07.zip llvm-b67d4690a897cae50cfe28a7b0401ffb7e729c07.tar.gz llvm-b67d4690a897cae50cfe28a7b0401ffb7e729c07.tar.bz2 |
[mips] Added support for -Wa,-mips32 and similar.
Reviewers: vkalintiris, dsanders
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D15070
llvm-svn: 257762
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r-- | clang/lib/Driver/Tools.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 5a2dbd3..5e4777b 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -2580,6 +2580,7 @@ static void CollectArgsForIntegratedAssembler(Compilation &C, // When using an integrated assembler, translate -Wa, and -Xassembler // options. bool CompressDebugSections = false; + const char *MipsTargetFeature = nullptr; for (const Arg *A : Args.filtered(options::OPT_Wa_COMMA, options::OPT_Xassembler)) { A->claim(); @@ -2618,7 +2619,26 @@ static void CollectArgsForIntegratedAssembler(Compilation &C, CmdArgs.push_back("-soft-float"); continue; } - break; + + MipsTargetFeature = llvm::StringSwitch<const char *>(Value) + .Case("-mips1", "+mips1") + .Case("-mips2", "+mips2") + .Case("-mips3", "+mips3") + .Case("-mips4", "+mips4") + .Case("-mips5", "+mips5") + .Case("-mips32", "+mips32") + .Case("-mips32r2", "+mips32r2") + .Case("-mips32r3", "+mips32r3") + .Case("-mips32r5", "+mips32r5") + .Case("-mips32r6", "+mips32r6") + .Case("-mips64", "+mips64") + .Case("-mips64r2", "+mips64r2") + .Case("-mips64r3", "+mips64r3") + .Case("-mips64r5", "+mips64r5") + .Case("-mips64r6", "+mips64r6") + .Default(nullptr); + if (MipsTargetFeature) + continue; } if (Value == "-force_cpusubtype_ALL") { @@ -2666,6 +2686,10 @@ static void CollectArgsForIntegratedAssembler(Compilation &C, else D.Diag(diag::warn_debug_compression_unavailable); } + if (MipsTargetFeature != nullptr) { + CmdArgs.push_back("-target-feature"); + CmdArgs.push_back(MipsTargetFeature); + } } // This adds the static libclang_rt.builtins-arch.a directly to the command line |