dim created this revision. dim added reviewers: t.p.northover, fpetrogalli, sdesmalen, az, LukeGeeson, stuij. Herald added a project: All. dim requested review of this revision. Herald added a project: clang.
As of https://reviews.llvm.org/D79708, clang-tblgen generates both `arm_neon.h` and `arm_bf16.h`, and both generated files will contain a typedef of `bfloat16_t`. However, `arm_neon.h` includes `arm_bf16.h` immediately before its own typedef: #include <arm_bf16.h> typedef __bf16 bfloat16_t; With a recent version of clang (I used 16.0.1) this results in warnings: /usr/lib/clang/16/include/arm_neon.h:38:16: error: redefinition of typedef 'bfloat16_t' is a C11 feature [-Werror,-Wtypedef-redefinition] Since `arm_bf16.h` is very likely supposed to be the one true place where `bfloat16_t` is defined, I propose to delete the duplicate typedef from the generated `arm_neon.h`. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D148822 Files: clang/utils/TableGen/NeonEmitter.cpp Index: clang/utils/TableGen/NeonEmitter.cpp =================================================================== --- clang/utils/TableGen/NeonEmitter.cpp +++ clang/utils/TableGen/NeonEmitter.cpp @@ -2353,7 +2353,6 @@ OS << "#include <stdint.h>\n\n"; OS << "#include <arm_bf16.h>\n"; - OS << "typedef __bf16 bfloat16_t;\n"; // Emit NEON-specific scalar typedefs. OS << "typedef float float32_t;\n";
Index: clang/utils/TableGen/NeonEmitter.cpp =================================================================== --- clang/utils/TableGen/NeonEmitter.cpp +++ clang/utils/TableGen/NeonEmitter.cpp @@ -2353,7 +2353,6 @@ OS << "#include <stdint.h>\n\n"; OS << "#include <arm_bf16.h>\n"; - OS << "typedef __bf16 bfloat16_t;\n"; // Emit NEON-specific scalar typedefs. OS << "typedef float float32_t;\n";
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits