mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-07 12:28:24 +00:00
Refactor: Simplify boolean expressions in x86 target
Simplify boolean expressions with `true` and `false` with `clang-tidy` Patch by Richard Thomson. Differential Revision: http://reviews.llvm.org/D8519 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233002 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -310,11 +310,8 @@ static bool isPrefixAtLocation(struct InternalInstruction* insn,
|
|||||||
uint8_t prefix,
|
uint8_t prefix,
|
||||||
uint64_t location)
|
uint64_t location)
|
||||||
{
|
{
|
||||||
if (insn->prefixPresent[prefix] == 1 &&
|
return insn->prefixPresent[prefix] == 1 &&
|
||||||
insn->prefixLocations[prefix] == location)
|
insn->prefixLocations[prefix] == location;
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -36,7 +36,7 @@ public:
|
|||||||
|
|
||||||
MCSymbol *Sym = Ctx.GetOrCreateSymbol(SymName);
|
MCSymbol *Sym = Ctx.GetOrCreateSymbol(SymName);
|
||||||
// FIXME: check that the value is actually the same.
|
// FIXME: check that the value is actually the same.
|
||||||
if (Sym->isVariable() == false)
|
if (!Sym->isVariable())
|
||||||
Sym->setVariableValue(MCConstantExpr::Create(SymAddr, Ctx));
|
Sym->setVariableValue(MCConstantExpr::Create(SymAddr, Ctx));
|
||||||
|
|
||||||
const MCExpr *Expr = nullptr;
|
const MCExpr *Expr = nullptr;
|
||||||
|
@@ -38,7 +38,7 @@ public:
|
|||||||
|
|
||||||
MCSymbol *Sym = Ctx.GetOrCreateSymbol(SymName);
|
MCSymbol *Sym = Ctx.GetOrCreateSymbol(SymName);
|
||||||
// FIXME: check that the value is actually the same.
|
// FIXME: check that the value is actually the same.
|
||||||
if (Sym->isVariable() == false)
|
if (!Sym->isVariable())
|
||||||
Sym->setVariableValue(MCConstantExpr::Create(SymAddr, Ctx));
|
Sym->setVariableValue(MCConstantExpr::Create(SymAddr, Ctx));
|
||||||
const MCExpr *Expr = nullptr;
|
const MCExpr *Expr = nullptr;
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ public:
|
|||||||
RSymI->getName(RSymName);
|
RSymI->getName(RSymName);
|
||||||
|
|
||||||
MCSymbol *RSym = Ctx.GetOrCreateSymbol(RSymName);
|
MCSymbol *RSym = Ctx.GetOrCreateSymbol(RSymName);
|
||||||
if (RSym->isVariable() == false)
|
if (!RSym->isVariable())
|
||||||
RSym->setVariableValue(MCConstantExpr::Create(RSymAddr, Ctx));
|
RSym->setVariableValue(MCConstantExpr::Create(RSymAddr, Ctx));
|
||||||
|
|
||||||
const MCExpr *RHS = MCSymbolRefExpr::Create(RSym, Ctx);
|
const MCExpr *RHS = MCSymbolRefExpr::Create(RSym, Ctx);
|
||||||
|
Reference in New Issue
Block a user