[mlir][emitc] Remove dead methods from emitter#167657
Merged
Conversation
This patch is a follow up on llvm#167532, which refactored these method's code into the relevant `printOperation()` functions but did not remove them.
Member
|
@llvm/pr-subscribers-mlir-emitc @llvm/pr-subscribers-mlir Author: Gil Rapaport (aniragil) ChangesThis patch is a follow up on #167532, which refactored these method's code into the relevant Full diff: https://github.com/llvm/llvm-project/pull/167657.diff 1 Files Affected:
diff --git a/mlir/lib/Target/Cpp/TranslateToCpp.cpp b/mlir/lib/Target/Cpp/TranslateToCpp.cpp
index ae209679ece6c..6bd76bb1ffc4b 100644
--- a/mlir/lib/Target/Cpp/TranslateToCpp.cpp
+++ b/mlir/lib/Target/Cpp/TranslateToCpp.cpp
@@ -189,15 +189,6 @@ struct CppEmitter {
/// emitc::ForOp.
StringRef getOrCreateInductionVarName(Value val);
- // Returns the textual representation of a subscript operation.
- std::string getSubscriptName(emitc::SubscriptOp op);
-
- // Returns the textual representation of a member (of object) operation.
- std::string createMemberAccess(emitc::MemberOp op);
-
- // Returns the textual representation of a member of pointer operation.
- std::string createMemberAccess(emitc::MemberOfPtrOp op);
-
/// Return the existing or a new label of a Block.
StringRef getOrCreateName(Block &block);
@@ -1387,32 +1378,6 @@ CppEmitter::CppEmitter(raw_ostream &os, bool declareVariablesAtTop,
labelInScopeCount.push(0);
}
-std::string CppEmitter::getSubscriptName(emitc::SubscriptOp op) {
- std::string out;
- llvm::raw_string_ostream ss(out);
- ss << getOrCreateName(op.getValue());
- for (auto index : op.getIndices()) {
- ss << "[" << getOrCreateName(index) << "]";
- }
- return out;
-}
-
-std::string CppEmitter::createMemberAccess(emitc::MemberOp op) {
- std::string out;
- llvm::raw_string_ostream ss(out);
- ss << getOrCreateName(op.getOperand());
- ss << "." << op.getMember();
- return out;
-}
-
-std::string CppEmitter::createMemberAccess(emitc::MemberOfPtrOp op) {
- std::string out;
- llvm::raw_string_ostream ss(out);
- ss << getOrCreateName(op.getOperand());
- ss << "->" << op.getMember();
- return out;
-}
-
void CppEmitter::cacheDeferredOpResult(Value value, StringRef str) {
if (!valueMapper.count(value))
valueMapper.insert(value, str.str());
|
simon-camp
approved these changes
Nov 13, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch is a follow up on #167532, which refactored these method's code into the relevant
printOperation()functions but did not remove them.