mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +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:
@@ -26,6 +26,7 @@
|
||||
#include "llvm/Support/PrettyStackTrace.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include "llvm/Support/Signals.h"
|
||||
#include "llvm/Support/system_error.h"
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
#include <cerrno>
|
||||
@@ -143,8 +144,11 @@ static void DumpSymbolNamesFromFile(std::string &Filename) {
|
||||
sys::Path aPath(Filename);
|
||||
// Note: Currently we do not support reading an archive from stdin.
|
||||
if (Filename == "-" || aPath.isBitcodeFile()) {
|
||||
error_code ec;
|
||||
std::auto_ptr<MemoryBuffer> Buffer(
|
||||
MemoryBuffer::getFileOrSTDIN(Filename, &ErrorMessage));
|
||||
MemoryBuffer::getFileOrSTDIN(Filename, ec));
|
||||
if (Buffer.get() == 0)
|
||||
ErrorMessage = ec.message();
|
||||
Module *Result = 0;
|
||||
if (Buffer.get())
|
||||
Result = ParseBitcodeFile(Buffer.get(), Context, &ErrorMessage);
|
||||
|
Reference in New Issue
Block a user