[llvm/Object] - Convert SectionRef::getName() to return Expected<>
SectionRef::getName() returns std::error_code now. Returning Expected<> instead has multiple benefits. For example, it forces user to check the error returned. Also Expected<> may keep a valuable string error message, what is more useful than having a error code. (Object\invalid.test was updated to show the new messages printed.) This patch makes a change for all users to switch to Expected<> version. Note: in a few places the error returned was ignored before my changes. In such places I left them ignored. My intention was to convert the interface used, and not to improve and/or the existent users in this patch. (Though I think this is good idea for a follow-ups to revisit such places and either remove consumeError calls or comment each of them to clarify why it is OK to have them). Differential revision: https://reviews.llvm.org/D66089 llvm-svn: 368812
Showing
- llvm/include/llvm/Object/ELFObjectFile.h 7 additions, 5 deletionsllvm/include/llvm/Object/ELFObjectFile.h
- llvm/include/llvm/Object/ObjectFile.h 3 additions, 7 deletionsllvm/include/llvm/Object/ObjectFile.h
- llvm/lib/DebugInfo/DWARF/DWARFContext.cpp 10 additions, 3 deletionsllvm/lib/DebugInfo/DWARF/DWARFContext.cpp
- llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp 5 additions, 4 deletionsllvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp
- llvm/lib/DebugInfo/Symbolize/Symbolize.cpp 5 additions, 1 deletionllvm/lib/DebugInfo/Symbolize/Symbolize.cpp
- llvm/lib/ExecutionEngine/JITLink/MachOAtomGraphBuilder.cpp 4 additions, 3 deletionsllvm/lib/ExecutionEngine/JITLink/MachOAtomGraphBuilder.cpp
- llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp 8 additions, 6 deletionsllvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
- llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp 23 additions, 11 deletionsllvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
- llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp 4 additions, 1 deletionllvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
- llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFX86_64.h 4 additions, 4 deletions...ecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFX86_64.h
- llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOARM.h 4 additions, 1 deletion...ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOARM.h
- llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOI386.h 4 additions, 1 deletion...xecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOI386.h
- llvm/lib/Object/COFFObjectFile.cpp 5 additions, 4 deletionsllvm/lib/Object/COFFObjectFile.cpp
- llvm/lib/Object/Decompressor.cpp 9 additions, 4 deletionsllvm/lib/Object/Decompressor.cpp
- llvm/lib/Object/ELFObjectFile.cpp 6 additions, 2 deletionsllvm/lib/Object/ELFObjectFile.cpp
- llvm/lib/Object/MachOObjectFile.cpp 9 additions, 6 deletionsllvm/lib/Object/MachOObjectFile.cpp
- llvm/lib/Object/Object.cpp 4 additions, 4 deletionsllvm/lib/Object/Object.cpp
- llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp 4 additions, 4 deletionsllvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp
- llvm/lib/XRay/InstrumentationMap.cpp 5 additions, 4 deletionsllvm/lib/XRay/InstrumentationMap.cpp
- llvm/test/Object/invalid.test 11 additions, 5 deletionsllvm/test/Object/invalid.test
Loading
Please register or sign in to comment