aboutsummaryrefslogtreecommitdiffstats
path: root/tools/llc
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-05-06 23:45:49 +0000
committerChris Lattner <sabre@nondot.org>2007-05-06 23:45:49 +0000
commit065344dfd5a7b3502098810b981eb0077e5d81f3 (patch)
tree6521b00f224a62ade1e796532e30c6cba5d36633 /tools/llc
parent5499da88331a31a9dcc24dc160f58b411fb0d34a (diff)
downloadexternal_llvm-065344dfd5a7b3502098810b981eb0077e5d81f3.zip
external_llvm-065344dfd5a7b3502098810b981eb0077e5d81f3.tar.gz
external_llvm-065344dfd5a7b3502098810b981eb0077e5d81f3.tar.bz2
use the new MemoryBuffer interfaces to simplify error reporting in clients.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36900 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llc')
-rw-r--r--tools/llc/llc.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp
index 0522420..8797c58 100644
--- a/tools/llc/llc.cpp
+++ b/tools/llc/llc.cpp
@@ -179,14 +179,10 @@ int main(int argc, char **argv) {
std::string ErrorMessage;
std::auto_ptr<Module> M;
- {
std::auto_ptr<MemoryBuffer> Buffer(
- MemoryBuffer::getFileOrSTDIN(&InputFilename[0], InputFilename.size()));
+ MemoryBuffer::getFileOrSTDIN(InputFilename, &ErrorMessage));
if (Buffer.get())
M.reset(ParseBitcodeFile(Buffer.get(), &ErrorMessage));
- else
- ErrorMessage = "Error reading file '" + InputFilename + "'";
- }
if (M.get() == 0) {
std::cerr << argv[0] << ": bytecode didn't read correctly.\n";
std::cerr << "Reason: " << ErrorMessage << "\n";