diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-05-27 20:26:41 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-05-27 20:26:41 +0000 |
commit | ff0cc061ecf297f1556e906d229826fd709f37d6 (patch) | |
tree | bd13a22d9db57ccf3eddbc07b32c18109521d050 /contrib/llvm/tools/llvm-as | |
parent | e14ba20ace4c6ab45aca5130defd992ab7d6bf5f (diff) | |
parent | 5a5ac124e1efaf208671f01c46edb15f29ed2a0b (diff) |
Merge llvm trunk r238337 from ^/vendor/llvm/dist, resolve conflicts, and
preserve our customizations, where necessary.
Notes
Notes:
svn path=/projects/clang-trunk/; revision=283631
Diffstat (limited to 'contrib/llvm/tools/llvm-as')
-rw-r--r-- | contrib/llvm/tools/llvm-as/llvm-as.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/contrib/llvm/tools/llvm-as/llvm-as.cpp b/contrib/llvm/tools/llvm-as/llvm-as.cpp index 5ccf505923f2..4455d24fb60d 100644 --- a/contrib/llvm/tools/llvm-as/llvm-as.cpp +++ b/contrib/llvm/tools/llvm-as/llvm-as.cpp @@ -51,20 +51,19 @@ static cl::opt<bool> DisableVerify("disable-verify", cl::Hidden, cl::desc("Do not run verifier on input LLVM (dangerous!)")); +static cl::opt<bool> PreserveBitcodeUseListOrder( + "preserve-bc-uselistorder", + cl::desc("Preserve use-list order when writing LLVM bitcode."), + cl::init(true), cl::Hidden); + static void WriteOutputFile(const Module *M) { // Infer the output filename if needed. if (OutputFilename.empty()) { if (InputFilename == "-") { OutputFilename = "-"; } else { - std::string IFN = InputFilename; - int Len = IFN.length(); - if (IFN[Len-3] == '.' && IFN[Len-2] == 'l' && IFN[Len-1] == 'l') { - // Source ends in .ll - OutputFilename = std::string(IFN.begin(), IFN.end()-3); - } else { - OutputFilename = IFN; // Append a .bc to it - } + StringRef IFN = InputFilename; + OutputFilename = (IFN.endswith(".ll") ? IFN.drop_back(3) : IFN).str(); OutputFilename += ".bc"; } } @@ -78,7 +77,7 @@ static void WriteOutputFile(const Module *M) { } if (Force || !CheckBitcodeOutputToConsole(Out->os(), true)) - WriteBitcodeToFile(M, Out->os()); + WriteBitcodeToFile(M, Out->os(), PreserveBitcodeUseListOrder); // Declare success. Out->keep(); |