diff options
| author | Daniel Sanders <daniel_l_sanders@apple.com> | 2017-10-31 18:07:03 +0000 |
|---|---|---|
| committer | Daniel Sanders <daniel_l_sanders@apple.com> | 2017-10-31 18:07:03 +0000 |
| commit | 6ea17edd80b1f267bd17f2adff57c2444658530b (patch) | |
| tree | f309cdb5337ab29006b793889653103d68f1be5c /llvm/utils/TableGen | |
| parent | dc417a9819c91cb3198d384e56f4090551330647 (diff) | |
| download | bcm5719-llvm-6ea17edd80b1f267bd17f2adff57c2444658530b.tar.gz bcm5719-llvm-6ea17edd80b1f267bd17f2adff57c2444658530b.zip | |
[globalisel][tablegen] Allow any comment in DebugCommentAction. NFC
llvm-svn: 317017
Diffstat (limited to 'llvm/utils/TableGen')
| -rw-r--r-- | llvm/utils/TableGen/GlobalISelEmitter.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/utils/TableGen/GlobalISelEmitter.cpp b/llvm/utils/TableGen/GlobalISelEmitter.cpp index f75456db870..85739bbab4a 100644 --- a/llvm/utils/TableGen/GlobalISelEmitter.cpp +++ b/llvm/utils/TableGen/GlobalISelEmitter.cpp @@ -1734,16 +1734,14 @@ public: /// Generates a comment describing the matched rule being acted upon. class DebugCommentAction : public MatchAction { private: - const PatternToMatch &P; + std::string S; public: - DebugCommentAction(const PatternToMatch &P) : P(P) {} + DebugCommentAction(StringRef S) : S(S) {} void emitActionOpcodes(MatchTable &Table, RuleMatcher &Rule, unsigned RecycleInsnID) const override { - Table << MatchTable::Comment(llvm::to_string(*P.getSrcPattern()) + " => " + - llvm::to_string(*P.getDstPattern())) - << MatchTable::LineBreak; + Table << MatchTable::Comment(S) << MatchTable::LineBreak; } }; @@ -2764,7 +2762,9 @@ Error GlobalISelEmitter::importImplicitDefRenderers( Expected<RuleMatcher> GlobalISelEmitter::runOnPattern(const PatternToMatch &P) { // Keep track of the matchers and actions to emit. RuleMatcher M(P.getSrcRecord()->getLoc()); - M.addAction<DebugCommentAction>(P); + M.addAction<DebugCommentAction>(llvm::to_string(*P.getSrcPattern()) + + " => " + + llvm::to_string(*P.getDstPattern())); if (auto Error = importRulePredicates(M, P.getPredicates())) return std::move(Error); |

