diff options
author | Mikhail Glushenkov <foldr@codedgers.com> | 2009-09-10 16:21:38 +0000 |
---|---|---|
committer | Mikhail Glushenkov <foldr@codedgers.com> | 2009-09-10 16:21:38 +0000 |
commit | 684a8b0f10cb43ed77ccc094cdeac6b4740d4598 (patch) | |
tree | a015db570ce73caf7e5fd5d850fe62feb15ccf6e /utils/TableGen | |
parent | 8018f5d5a4134f8b2ceb315095996a552a80ee25 (diff) | |
download | external_llvm-684a8b0f10cb43ed77ccc094cdeac6b4740d4598.zip external_llvm-684a8b0f10cb43ed77ccc094cdeac6b4740d4598.tar.gz external_llvm-684a8b0f10cb43ed77ccc094cdeac6b4740d4598.tar.bz2 |
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
Diffstat (limited to 'utils/TableGen')
-rw-r--r-- | utils/TableGen/LLVMCConfigurationEmitter.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/utils/TableGen/LLVMCConfigurationEmitter.cpp b/utils/TableGen/LLVMCConfigurationEmitter.cpp index 6bade9b..8a5b36a 100644 --- a/utils/TableGen/LLVMCConfigurationEmitter.cpp +++ b/utils/TableGen/LLVMCConfigurationEmitter.cpp @@ -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)) |