mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-16 00:17:32 +00:00
Add a logical 'not' operator to llvmc's TableGen dialect.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81447 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8018f5d5a4
commit
684a8b0f10
@ -59,6 +59,7 @@ def false;
|
||||
// Boolean operators.
|
||||
def and;
|
||||
def or;
|
||||
def not;
|
||||
|
||||
// Primitive tests.
|
||||
def switch_on;
|
||||
|
@ -1074,6 +1074,16 @@ void EmitLogicalOperationTest(const DagInit& d, const char* LogicOp,
|
||||
}
|
||||
}
|
||||
|
||||
void EmitLogicalNot(const DagInit& d, const char* IndentLevel,
|
||||
const OptionDescriptions& OptDescs, raw_ostream& O)
|
||||
{
|
||||
checkNumberOfArguments(&d, 1);
|
||||
const DagInit& InnerTest = InitPtrToDag(d.getArg(0));
|
||||
O << "! (";
|
||||
EmitCaseTest(InnerTest, IndentLevel, OptDescs, O);
|
||||
O << ")";
|
||||
}
|
||||
|
||||
/// EmitCaseTest - Helper function used by EmitCaseConstructHandler.
|
||||
void EmitCaseTest(const DagInit& d, const char* IndentLevel,
|
||||
const OptionDescriptions& OptDescs,
|
||||
@ -1084,6 +1094,8 @@ void EmitCaseTest(const DagInit& d, const char* IndentLevel,
|
||||
EmitLogicalOperationTest(d, "&&", IndentLevel, OptDescs, O);
|
||||
else if (TestName == "or")
|
||||
EmitLogicalOperationTest(d, "||", IndentLevel, OptDescs, O);
|
||||
else if (TestName == "not")
|
||||
EmitLogicalNot(d, IndentLevel, OptDescs, O);
|
||||
else if (EmitCaseTest1Arg(TestName, d, OptDescs, O))
|
||||
return;
|
||||
else if (EmitCaseTest2Args(TestName, d, IndentLevel, OptDescs, O))
|
||||
|
Loading…
Reference in New Issue
Block a user