Skip to content

Commit bba942c

Browse files
committed
[mlir] Address clang-tidy remarks. NFC
1 parent 2596e32 commit bba942c

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

libsolidity/codegen/mlir/Passes.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include "mlir/Transforms/Passes.h"
2828
#include "llvm-c/Core.h"
2929
#include "llvm-c/Target.h"
30-
#include "llvm-c/TargetMachine.h"
3130
#include "llvm-c/Transforms/PassBuilder.h"
3231
#include "llvm-c/Types.h"
3332
#include "llvm/ADT/SmallString.h"
@@ -229,8 +228,6 @@ static mlir::ModuleOp extractRuntimeModule(mlir::ModuleOp creationMod) {
229228
return {};
230229
}
231230

232-
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(llvm::TargetMachine, LLVMTargetMachineRef)
233-
234231
static LLVMMemoryBufferRef genObj(llvm::Module &mod,
235232
llvm::TargetMachine &tgtMach) {
236233
LLVMTargetMachineRef tgtMachWrapped = wrap(&tgtMach);

libsolidity/codegen/mlir/Passes.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "mlir/Pass/PassManager.h"
3131
#include "mlir/Support/LLVM.h"
3232
#include "mlir/Transforms/DialectConversion.h"
33+
#include "llvm-c/TargetMachine.h"
3334
#include "llvm/IR/Module.h"
3435
#include "llvm/Target/TargetMachine.h"
3536
#include <memory>
@@ -92,3 +93,7 @@ genEvmBytecode(frontend::ContractDefinition const *cont,
9293
Bytecode genEraVMBytecode(llvm::Module &llvmMod, llvm::TargetMachine &tgtMach);
9394

9495
} // namespace solidity::mlirgen
96+
97+
namespace llvm {
98+
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(llvm::TargetMachine, LLVMTargetMachineRef)
99+
}

libsolidity/codegen/mlir/Target/EraVM/YulToStandard.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@
5252

5353
using namespace mlir;
5454

55-
namespace {
56-
5755
/// Returns true if `op` is defined in a runtime context
5856
static bool inRuntimeContext(Operation *op) {
5957
assert(!isa<sol::FuncOp>(op) && !isa<yul::ObjectOp>(op));
@@ -72,6 +70,8 @@ static bool inRuntimeContext(Operation *op) {
7270
llvm_unreachable("op has no parent FuncOp or ObjectOp");
7371
}
7472

73+
namespace {
74+
7575
struct Keccak256OpLowering : public OpRewritePattern<yul::Keccak256Op> {
7676
using OpRewritePattern<yul::Keccak256Op>::OpRewritePattern;
7777

0 commit comments

Comments
 (0)