================ @@ -29,6 +29,14 @@ void BPFTargetInfo::getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const { Builder.defineMacro("__bpf__"); Builder.defineMacro("__BPF__"); + + std::string CPU = getTargetOpts().CPU; + if (CPU == "probe") + Builder.defineMacro("__bpf_cpu_version__", "0"); + else if (CPU.empty() || CPU == "generic") + Builder.defineMacro("__bpf_cpu_version__", "1"); + else + Builder.defineMacro("__bpf_cpu_version__", CPU.substr(1)); ---------------- yonghong-song wrote:
Okay, I don't particularly like __BPF_CPU_VERSION either and actually prefer double underscore before and after BPF_CPU_VERSION. Now, I realize that you actually mean with double underscore before and after BPF_CPU_VERSION. github just displays as highlight. https://github.com/llvm/llvm-project/pull/71856 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits