Issue |
154756
|
Summary |
clang-tidy incorrect readability-identifier-naming
|
Labels |
clang-tidy
|
Assignees |
|
Reporter |
joker-eph
|
With clang-tidy built at current head and applying it on MLIR:
```
$ /bin/clang-tidy -p build mlir/lib/CAPI/Target/LLVMIR.cpp --checks=-*,readability-identifier-naming -fix -fix-errors
```
I get this diff:
```
diff --git a/mlir/lib/CAPI/Target/LLVMIR.cpp b/mlir/lib/CAPI/Target/LLVMIR.cpp
index 1c1912aec0f2..10c501c962c0 100644
--- a/mlir/lib/CAPI/Target/LLVMIR.cpp
+++ b/mlir/lib/CAPI/Target/LLVMIR.cpp
@@ -51,8 +51,8 @@ void mlirTypeFromLLVMIRTranslatorDestroy(
MlirType mlirTypeFromLLVMIRTranslatorTranslateType(
MlirTypeFromLLVMIRTranslator translator, LLVMTypeRef llvmType) {
- LLVM::TypeFromLLVMIRTranslator *translator_ = unwrap(translator);
- mlir::Type type = translator_->translateType(llvm::unwrap(llvmType));
+ LLVM::TypeFromLLVMIRTranslator *translator = unwrap(translator);
+ mlir::Type type = translator->translateType(llvm::unwrap(llvmType));
return wrap(type);
}
@@ -73,7 +73,7 @@ void mlirTypeToLLVMIRTranslatorDestroy(MlirTypeToLLVMIRTranslator translator) {
LLVMTypeRef
mlirTypeToLLVMIRTranslatorTranslateType(MlirTypeToLLVMIRTranslator translator,
MlirType mlirType) {
- LLVM::TypeToLLVMIRTranslator *translator_ = unwrap(translator);
- llvm::Type *type = translator_->translateType(unwrap(mlirType));
+ LLVM::TypeToLLVMIRTranslator *translator = unwrap(translator);
+ llvm::Type *type = translator->translateType(unwrap(mlirType));
return llvm::wrap(type);
}
```
Which fails obviously:
```
mlir/lib/CAPI/Target/LLVMIR.cpp:54:35: error: redefinition of 'translator' with a different type: 'LLVM::TypeFromLLVMIRTranslator *' vs 'MlirTypeFromLLVMIRTranslator'
54 | LLVM::TypeFromLLVMIRTranslator *translator = unwrap(translator);
| ^
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs