diff options
author | Stephen Hines <srhines@google.com> | 2014-12-01 14:51:49 -0800 |
---|---|---|
committer | Stephen Hines <srhines@google.com> | 2014-12-02 16:08:10 -0800 |
commit | 37ed9c199ca639565f6ce88105f9e39e898d82d0 (patch) | |
tree | 8fb36d3910e3ee4c4e1b7422f4f017108efc52f5 /tools/llvm-mc/llvm-mc.cpp | |
parent | d2327b22152ced7bc46dc629fc908959e8a52d03 (diff) | |
download | external_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.tar.gz external_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.tar.bz2 external_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.zip |
Update aosp/master LLVM for rebase to r222494.
Change-Id: Ic787f5e0124df789bd26f3f24680f45e678eef2d
Diffstat (limited to 'tools/llvm-mc/llvm-mc.cpp')
-rw-r--r-- | tools/llvm-mc/llvm-mc.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp index 4c5b230573..5da9e86623 100644 --- a/tools/llvm-mc/llvm-mc.cpp +++ b/tools/llvm-mc/llvm-mc.cpp @@ -208,11 +208,11 @@ static tool_output_file *GetOutputStream() { if (OutputFilename == "") OutputFilename = "-"; - std::string Err; + std::error_code EC; tool_output_file *Out = - new tool_output_file(OutputFilename.c_str(), Err, sys::fs::F_None); - if (!Err.empty()) { - errs() << Err << '\n'; + new tool_output_file(OutputFilename, EC, sys::fs::F_None); + if (EC) { + errs() << EC.message() << '\n'; delete Out; return nullptr; } @@ -373,12 +373,12 @@ int main(int argc, char **argv) { errs() << ProgName << ": " << EC.message() << '\n'; return 1; } - MemoryBuffer *Buffer = BufferPtr->release(); + MemoryBuffer *Buffer = BufferPtr->get(); SourceMgr SrcMgr; // Tell SrcMgr about this buffer, which is what the parser will pick up. - SrcMgr.AddNewSourceBuffer(Buffer, SMLoc()); + SrcMgr.AddNewSourceBuffer(std::move(*BufferPtr), SMLoc()); // Record the location of the include directories so that the lexer can find // it later. @@ -471,9 +471,10 @@ int main(int argc, char **argv) { assert(FileType == OFT_ObjectFile && "Invalid file type!"); MCCodeEmitter *CE = TheTarget->createMCCodeEmitter(*MCII, *MRI, *STI, Ctx); MCAsmBackend *MAB = TheTarget->createMCAsmBackend(*MRI, TripleName, MCPU); - Str.reset(TheTarget->createMCObjectStreamer(TripleName, Ctx, *MAB, - FOS, CE, *STI, RelaxAll, - NoExecStack)); + Str.reset(TheTarget->createMCObjectStreamer(TripleName, Ctx, *MAB, FOS, CE, + *STI, RelaxAll)); + if (NoExecStack) + Str->InitSections(true); } int Res = 1; |