mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Support/MemoryBuffer: Replace all uses of std::string *ErrMsg with error_code &ec. And fix clients.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121379 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include "llvm/Support/PrettyStackTrace.h"
|
||||
#include "llvm/Support/ToolOutputFile.h"
|
||||
#include "llvm/Support/Signals.h"
|
||||
#include "llvm/Support/system_error.h"
|
||||
using namespace llvm;
|
||||
|
||||
static cl::opt<std::string>
|
||||
@@ -78,13 +79,14 @@ int main(int argc, char **argv) {
|
||||
cl::ParseCommandLineOptions(argc, argv, "llvm .bc -> .ll disassembler\n");
|
||||
|
||||
std::string ErrorMessage;
|
||||
error_code ec;
|
||||
std::auto_ptr<Module> M;
|
||||
|
||||
if (MemoryBuffer *Buffer
|
||||
= MemoryBuffer::getFileOrSTDIN(InputFilename, &ErrorMessage)) {
|
||||
|
||||
if (MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(InputFilename, ec)) {
|
||||
M.reset(ParseBitcodeFile(Buffer, Context, &ErrorMessage));
|
||||
delete Buffer;
|
||||
}
|
||||
} else
|
||||
ErrorMessage = ec.message();
|
||||
|
||||
if (M.get() == 0) {
|
||||
errs() << argv[0] << ": ";
|
||||
|
Reference in New Issue
Block a user