Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(297)

Side by Side Diff: tools/llvm-nm/llvm-nm.cpp

Issue 770853002: Fix error reporting in the PNaCl bitcode reader. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: Fix nits. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 //===-- llvm-nm.cpp - Symbol table dumping utility for llvm ---------------===// 1 //===-- llvm-nm.cpp - Symbol table dumping utility for llvm ---------------===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This program is a utility that works like traditional Unix "nm", that is, it 10 // This program is a utility that works like traditional Unix "nm", that is, it
(...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 MemoryBuffer::getFileOrSTDIN(Filename); 1004 MemoryBuffer::getFileOrSTDIN(Filename);
1005 if (error(BufferOrErr.getError(), Filename)) 1005 if (error(BufferOrErr.getError(), Filename))
1006 return; 1006 return;
1007 1007
1008 LLVMContext &Context = getGlobalContext(); 1008 LLVMContext &Context = getGlobalContext();
1009 1009
1010 // @LOCALMOD-BEGIN 1010 // @LOCALMOD-BEGIN
1011 // Support parsing PNaCl bitcode files 1011 // Support parsing PNaCl bitcode files
1012 /* TODO(jfb) This is currently broken: the code base now requires an Object. 1012 /* TODO(jfb) This is currently broken: the code base now requires an Object.
1013 if (InputFileFormat == PNaClFormat) { 1013 if (InputFileFormat == PNaClFormat) {
1014 std::string ErrorMessage; 1014 ErrorOr<Module *>Result =
jvoung (off chromium) 2014/12/01 23:23:50 space between > and Result
Karl 2014/12/03 18:32:10 Done.
1015 Module *Result = NaClParseBitcodeFile(BufferOrErr.get().release(), Context, 1015 NaClParseBitcodeFile(BufferOrErr.get().release(), Context);
1016 &ErrorMessage);
1017 if (Result) { 1016 if (Result) {
1018 DumpSymbolNamesFromModule(Result); 1017 DumpSymbolNamesFromModule(Result.get());
1019 delete Result; 1018 delete Result;
1020 } else { 1019 } else {
1021 error(ErrorMessage, Filename); 1020 error(Result.message(), Filename);
1022 return; 1021 return;
1023 } 1022 }
1024 } 1023 }
1025 */ 1024 */
1026 // @LOCALMOD-END 1025 // @LOCALMOD-END
1027 1026
1028 ErrorOr<Binary *> BinaryOrErr = 1027 ErrorOr<Binary *> BinaryOrErr =
1029 createBinary(std::move(*BufferOrErr), &Context); 1028 createBinary(std::move(*BufferOrErr), &Context);
1030 if (error(BinaryOrErr.getError(), Filename)) 1029 if (error(BinaryOrErr.getError(), Filename))
1031 return; 1030 return;
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
1265 "for the -s option"); 1264 "for the -s option");
1266 1265
1267 std::for_each(InputFilenames.begin(), InputFilenames.end(), 1266 std::for_each(InputFilenames.begin(), InputFilenames.end(),
1268 dumpSymbolNamesFromFile); 1267 dumpSymbolNamesFromFile);
1269 1268
1270 if (HadError) 1269 if (HadError)
1271 return 1; 1270 return 1;
1272 1271
1273 return 0; 1272 return 0;
1274 } 1273 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698