-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[NFC][DecoderEmitter] Remove unused emitPredicateMatchAux
#158771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
emitPredicateMatchAux
@llvm/pr-subscribers-tablegen Author: Rahul Joshi (jurahul) ChangesFollow up to #158014, the Full diff: https://github.com/llvm/llvm-project/pull/158771.diff 1 Files Affected:
diff --git a/llvm/utils/TableGen/DecoderEmitter.cpp b/llvm/utils/TableGen/DecoderEmitter.cpp
index 97a6b58e1bd99..a54e6d05dd60e 100644
--- a/llvm/utils/TableGen/DecoderEmitter.cpp
+++ b/llvm/utils/TableGen/DecoderEmitter.cpp
@@ -515,9 +515,6 @@ class DecoderTableBuilder {
unsigned getPredicateIndex(StringRef P) const;
- bool emitPredicateMatchAux(const Init &Val, bool ParenIfBinOp,
- raw_ostream &OS) const;
-
bool emitPredicateMatch(raw_ostream &OS, unsigned EncodingID) const;
void emitPredicateTableEntry(unsigned EncodingID) const;
@@ -1099,40 +1096,6 @@ unsigned DecoderTableBuilder::getDecoderIndex(unsigned EncodingID) const {
return std::distance(Decoders.begin(), P);
}
-// If ParenIfBinOp is true, print a surrounding () if Val uses && or ||.
-bool DecoderTableBuilder::emitPredicateMatchAux(const Init &Val,
- bool ParenIfBinOp,
- raw_ostream &OS) const {
- if (const auto *D = dyn_cast<DefInit>(&Val)) {
- if (!D->getDef()->isSubClassOf("SubtargetFeature"))
- return true;
- OS << "Bits[" << Target.getName() << "::" << D->getAsString() << "]";
- return false;
- }
- if (const auto *D = dyn_cast<DagInit>(&Val)) {
- std::string Op = D->getOperator()->getAsString();
- if (Op == "not" && D->getNumArgs() == 1) {
- OS << '!';
- return emitPredicateMatchAux(*D->getArg(0), true, OS);
- }
- if ((Op == "any_of" || Op == "all_of") && D->getNumArgs() > 0) {
- bool Paren = D->getNumArgs() > 1 && std::exchange(ParenIfBinOp, true);
- if (Paren)
- OS << '(';
- ListSeparator LS(Op == "any_of" ? " || " : " && ");
- for (auto *Arg : D->getArgs()) {
- OS << LS;
- if (emitPredicateMatchAux(*Arg, ParenIfBinOp, OS))
- return true;
- }
- if (Paren)
- OS << ')';
- return false;
- }
- }
- return true;
-}
-
// Returns true if there was any predicate emitted.
bool DecoderTableBuilder::emitPredicateMatch(raw_ostream &OS,
unsigned EncodingID) const {
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/211/builds/2037 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/55/builds/17230 Here is the relevant piece of the build log for the reference
|
Follow up to #158014, the
emitPredicateMatchAux
is now unused, so remove it.