[Mlir-commits] [mlir] 8ae3ac8 - [mlir][emitc] Remove dead methods from emitter (#167657)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Thu Nov 13 10:25:39 PST 2025
Author: Gil Rapaport
Date: 2025-11-13T20:25:35+02:00
New Revision: 8ae3ac82135b0394a404f2901a70159a85539ee1
URL: https://github.com/llvm/llvm-project/commit/8ae3ac82135b0394a404f2901a70159a85539ee1
DIFF: https://github.com/llvm/llvm-project/commit/8ae3ac82135b0394a404f2901a70159a85539ee1.diff
LOG: [mlir][emitc] Remove dead methods from emitter (#167657)
This patch is a follow up on #167532, which refactored these method's
code into the relevant `printOperation()` functions but did not remove
them.
Added:
Modified:
mlir/lib/Target/Cpp/TranslateToCpp.cpp
Removed:
################################################################################
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());
More information about the Mlir-commits
mailing list