Now that llc can read .ll files directly, teach it to recognize .ll as

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
This commit is contained in:
Dan Gohman 2009-09-16 19:18:41 +00:00
parent 1b75f44bd9
commit d81c450afc

View 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;