From 065344dfd5a7b3502098810b981eb0077e5d81f3 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 6 May 2007 23:45:49 +0000 Subject: 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 --- tools/lli/lli.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'tools/lli') diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp index a1caf1172d..fdb5f4aa39 100644 --- a/tools/lli/lli.cpp +++ b/tools/lli/lli.cpp @@ -77,11 +77,7 @@ int main(int argc, char **argv, char * const *envp) { // Load the bytecode... std::string ErrorMsg; ModuleProvider *MP = 0; - MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(&InputFile[0], - InputFile.size()); - if (Buffer == 0) - ErrorMsg = "Error reading file '" + InputFile + "'"; - else { + if (MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(InputFile,&ErrorMsg)){ MP = getBitcodeModuleProvider(Buffer, &ErrorMsg); if (!MP) delete Buffer; } -- cgit v1.2.3