aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-ml/llvm-ml.cpp
diff options
context:
space:
mode:
authorAlan Zhao <ayzhao@google.com>2022-05-25 18:06:08 -0400
committerAlan Zhao <ayzhao@google.com>2022-05-25 22:10:05 -0400
commit65fd1e91b0f864f6f97742f2ed5d0243a9dc8f55 (patch)
tree8219358b0d822edafffdbff3095601c285b6c6a7 /llvm/tools/llvm-ml/llvm-ml.cpp
parent8aa6b05deb2ace6042274c9a33ff40523444f459 (diff)
downloadllvm-65fd1e91b0f864f6f97742f2ed5d0243a9dc8f55.zip
llvm-65fd1e91b0f864f6f97742f2ed5d0243a9dc8f55.tar.gz
llvm-65fd1e91b0f864f6f97742f2ed5d0243a9dc8f55.tar.bz2
[llvm-ml] Add support for the .S extension
Even though MASM files typically have the .asm extension, there are some use cases [0] where they have the .S extension. MSVC ml assembles such files with no problems, so llvm-ml should as well. Additionally, fix the implementation of the /Ta flag and add a test for it. [0]: https://crrev.com/c/3668287 Reviewed By: epastor Differential Revision: https://reviews.llvm.org/D126425
Diffstat (limited to 'llvm/tools/llvm-ml/llvm-ml.cpp')
-rw-r--r--llvm/tools/llvm-ml/llvm-ml.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/tools/llvm-ml/llvm-ml.cpp b/llvm/tools/llvm-ml/llvm-ml.cpp
index 2fd218a..2651132f2 100644
--- a/llvm/tools/llvm-ml/llvm-ml.cpp
+++ b/llvm/tools/llvm-ml/llvm-ml.cpp
@@ -208,7 +208,9 @@ int main(int Argc, char **Argv) {
std::string InputFilename;
for (auto *Arg : InputArgs.filtered(OPT_INPUT)) {
std::string ArgString = Arg->getAsString(InputArgs);
- if (ArgString == "-" || StringRef(ArgString).endswith(".asm")) {
+ StringRef ArgStringRef(ArgString);
+ if (ArgString == "-" || ArgStringRef.endswith(".asm") ||
+ ArgStringRef.endswith(".S")) {
if (!InputFilename.empty()) {
WithColor::warning(errs(), ProgName)
<< "does not support multiple assembly files in one command; "
@@ -234,7 +236,7 @@ int main(int Argc, char **Argv) {
<< "does not support multiple assembly files in one command; "
<< "ignoring '" << InputFilename << "'\n";
}
- InputFilename = Arg->getAsString(InputArgs);
+ InputFilename = Arg->getValue();
}
for (auto *Arg : InputArgs.filtered(OPT_unsupported_Group)) {