1
0
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:
Benjamin Kramer 2016-02-16 09:53:47 +00:00
parent a0396b8473
commit 9505fd87c8
2 changed files with 1 additions and 1 deletions

View File

@ -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;

View File

@ -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();
}