llvm-capstone/lldb/source/Expression
Raphael Isemann f18370fe0e [lldb] Don't defend against internal LLVM errors in IRInterpreter
Summary:
Whenever we cast an LLVM instruction to one of its subclasses, we do a double check if the RTTI
enum value actually allows us to cast the class. I don't see a way this can ever happen as even when
LLVM's RTTI system has some corrupt internal state (which we probably should not test in the first
place) we just reuse LLVM RTTI to do the second check.

This also means that if we ever make an actual programming error in this function (e.g., have a enum
value and then cast it to a different subclass), we just silently fall back to the JIT in our tests.

We also can't test this code in any reasonable way.

This removes the checks and uses `llvm::cast` instead which will raise a fatal error when casting fails.

Reviewers: labath, mib

Reviewed By: labath

Subscribers: abidh, JDevlieghere, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D72596
2020-01-14 09:55:34 +01:00
..
CMakeLists.txt
DiagnosticManager.cpp [lldb][NFC] Use unique_ptr in DiagnosticManager to express ownership 2019-10-10 08:30:10 +00:00
DWARFExpression.cpp [lldb/DWARF] Fix mixed v4+v5 location lists 2020-01-09 13:19:29 +01:00
Expression.cpp [lldb][NFC] Move LLVM RTTI implementation from enum to static ID variable 2019-11-12 10:04:32 +01:00
ExpressionVariable.cpp Revert "[lldb] Move redundant persistent variable counter to ClangPersistentVariables" 2019-08-27 22:50:40 +00:00
FunctionCaller.cpp [lldb][NFC] Move LLVM RTTI implementation from enum to static ID variable 2019-11-12 10:04:32 +01:00
IRExecutionUnit.cpp [lldb] Fix ARM32 inferior calls 2019-12-21 11:12:17 +01:00
IRInterpreter.cpp [lldb] Don't defend against internal LLVM errors in IRInterpreter 2020-01-14 09:55:34 +01:00
IRMemoryMap.cpp [lldb] Fix ARM32 inferior calls 2019-12-21 11:12:17 +01:00
LLVMUserExpression.cpp [lldb][NFC] Move LLVM RTTI implementation from enum to static ID variable 2019-11-12 10:04:32 +01:00
Materializer.cpp
REPL.cpp Add missing nullptr checks. 2020-01-10 08:52:46 -08:00
UserExpression.cpp Add missing nullptr checks. 2020-01-10 08:52:46 -08:00
UtilityFunction.cpp [lldb][NFC] Move LLVM RTTI implementation from enum to static ID variable 2019-11-12 10:04:32 +01:00