OSDN Git Service

Now that llc can read .ll files directly, teach it to recognize .ll as
authorDan Gohman <gohman@apple.com>
Wed, 16 Sep 2009 19:18:41 +0000 (19:18 +0000)
committerDan Gohman <gohman@apple.com>
Wed, 16 Sep 2009 19:18:41 +0000 (19:18 +0000)
an extension, so that the default output filename for foo.ll is foo.s,
not foo.ll.s

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82071 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llc/llc.cpp

index f6fccbe..b94e5fb 100644 (file)
@@ -119,7 +119,9 @@ GetFileNameRoot(const std::string &InputFilename) {
   std::string outputFilename;
   int Len = IFN.length();
   if ((Len > 2) &&
-      IFN[Len-3] == '.' && IFN[Len-2] == 'b' && IFN[Len-1] == 'c') {
+      IFN[Len-3] == '.' &&
+      ((IFN[Len-2] == 'b' && IFN[Len-1] == 'c') ||
+       (IFN[Len-2] == 'l' && IFN[Len-1] == 'l'))) {
     outputFilename = std::string(IFN.begin(), IFN.end()-3); // s/.bc/.s/
   } else {
     outputFilename = IFN;