mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 11:02:59 +02:00
[Hexagon] Hoist nonnull assert up.
Once a pointer is turned into a reference it cannot be nullptr, clang rightfully warns about this assert being a tautology. Put the assert before the reference is created. llvm-svn: 260949
This commit is contained in:
parent
a0396b8473
commit
9505fd87c8
@ -592,7 +592,6 @@ public:
|
||||
|
||||
static std::unique_ptr<HexagonOperand> CreateImm(const MCExpr *Val, SMLoc S,
|
||||
SMLoc E) {
|
||||
assert(&HexagonMCInstrInfo::getExpr(*Val) != nullptr);
|
||||
HexagonOperand *Op = new HexagonOperand(Immediate);
|
||||
Op->Imm.Val = Val;
|
||||
Op->Imm.MustExtend = false;
|
||||
|
@ -193,6 +193,7 @@ MCInstrDesc const &HexagonMCInstrInfo::getDesc(MCInstrInfo const &MCII,
|
||||
|
||||
MCExpr const &HexagonMCInstrInfo::getExpr(MCExpr const &Expr) {
|
||||
HexagonMCExpr const &HExpr = *llvm::cast<HexagonMCExpr>(&Expr);
|
||||
assert(HExpr.getExpr());
|
||||
return *HExpr.getExpr();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user