mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +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:
@ -30,6 +30,7 @@
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include "llvm/Support/Format.h"
|
||||
#include "llvm/Support/Signals.h"
|
||||
#include "llvm/Support/system_error.h"
|
||||
#include <algorithm>
|
||||
#include <iomanip>
|
||||
#include <map>
|
||||
@ -263,12 +264,13 @@ int main(int argc, char **argv) {
|
||||
|
||||
// Read in the bitcode file...
|
||||
std::string ErrorMessage;
|
||||
error_code ec;
|
||||
Module *M = 0;
|
||||
if (MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(BitcodeFile,
|
||||
&ErrorMessage)) {
|
||||
if (MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(BitcodeFile, ec)) {
|
||||
M = ParseBitcodeFile(Buffer, Context, &ErrorMessage);
|
||||
delete Buffer;
|
||||
}
|
||||
} else
|
||||
ErrorMessage = ec.message();
|
||||
if (M == 0) {
|
||||
errs() << argv[0] << ": " << BitcodeFile << ": "
|
||||
<< ErrorMessage << "\n";
|
||||
|
Reference in New Issue
Block a user