mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
3e3b10a540
Summary: The functions different in two ways: - getLLVMRegNum could return both "eh" and "other" dwarf register numbers, while getLLVMRegNumFromEH only returned the "eh" number. - getLLVMRegNum asserted if the register was not found, while the second function returned -1. The second distinction was pretty important, but it was very hard to infer that from the function name. Aditionally, for the use case of dumping dwarf expressions, we needed a function which can work with both kinds of number, but does not assert. This patch solves both of these issues by merging the two functions into one, returning an Optional<unsigned> value. While the same thing could be achieved by adding an "IsEH" argument to the (renamed) getLLVMRegNumFromEH function, it seemed better to avoid the confusion of two functions and put the choice of asserting into the hands of the caller -- if he checks the Optional value, he can safely process "untrusted" input, and if he blindly dereferences the Optional, he gets the assertion. I've updated all call sites to the new API, choosing between the two options according to the function they were calling originally, except that I've updated the usage in DWARFExpression.cpp to use the "safe" method instead, and added a test case which would have previously triggered an assertion failure when processing (incorrect?) dwarf expressions. Reviewers: dsanders, arsenm, JDevlieghere Subscribers: wdng, aprantl, javed.absar, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67154 llvm-svn: 372710 |
||
---|---|---|
.. | ||
MCDisassembler | ||
MCParser | ||
CMakeLists.txt | ||
ConstantPools.cpp | ||
ELFObjectWriter.cpp | ||
LLVMBuild.txt | ||
MachObjectWriter.cpp | ||
MCAsmBackend.cpp | ||
MCAsmInfo.cpp | ||
MCAsmInfoCOFF.cpp | ||
MCAsmInfoDarwin.cpp | ||
MCAsmInfoELF.cpp | ||
MCAsmInfoWasm.cpp | ||
MCAsmInfoXCOFF.cpp | ||
MCAsmMacro.cpp | ||
MCAsmStreamer.cpp | ||
MCAssembler.cpp | ||
MCCodeEmitter.cpp | ||
MCCodePadder.cpp | ||
MCCodeView.cpp | ||
MCContext.cpp | ||
MCDwarf.cpp | ||
MCELFObjectTargetWriter.cpp | ||
MCELFStreamer.cpp | ||
MCExpr.cpp | ||
MCFragment.cpp | ||
MCInst.cpp | ||
MCInstPrinter.cpp | ||
MCInstrAnalysis.cpp | ||
MCInstrDesc.cpp | ||
MCLabel.cpp | ||
MCLinkerOptimizationHint.cpp | ||
MCMachObjectTargetWriter.cpp | ||
MCMachOStreamer.cpp | ||
MCNullStreamer.cpp | ||
MCObjectFileInfo.cpp | ||
MCObjectStreamer.cpp | ||
MCObjectWriter.cpp | ||
MCRegisterInfo.cpp | ||
MCSchedule.cpp | ||
MCSection.cpp | ||
MCSectionCOFF.cpp | ||
MCSectionELF.cpp | ||
MCSectionMachO.cpp | ||
MCSectionWasm.cpp | ||
MCSectionXCOFF.cpp | ||
MCStreamer.cpp | ||
MCSubtargetInfo.cpp | ||
MCSymbol.cpp | ||
MCSymbolELF.cpp | ||
MCTargetOptions.cpp | ||
MCValue.cpp | ||
MCWasmObjectTargetWriter.cpp | ||
MCWasmStreamer.cpp | ||
MCWin64EH.cpp | ||
MCWinCOFFStreamer.cpp | ||
MCWinEH.cpp | ||
MCXCOFFObjectTargetWriter.cpp | ||
MCXCOFFStreamer.cpp | ||
StringTableBuilder.cpp | ||
SubtargetFeature.cpp | ||
WasmObjectWriter.cpp | ||
WinCOFFObjectWriter.cpp | ||
XCOFFObjectWriter.cpp |