mirror of
https://github.com/intel/llvm.git
synced 2026-01-27 06:06:34 +08:00
[Clang][BPF] Add __BPF_FEATURE_GOTOX (#165456)
Add a macro __BPF_FEATURE_GOTOX for bpf target for cpu v4. So the developer can easily detect whether insn gotox is supported or not.
This commit is contained in:
@@ -75,6 +75,7 @@ void BPFTargetInfo::getTargetDefines(const LangOptions &Opts,
|
||||
Builder.defineMacro("__BPF_FEATURE_GOTOL");
|
||||
Builder.defineMacro("__BPF_FEATURE_ST");
|
||||
Builder.defineMacro("__BPF_FEATURE_LOAD_ACQ_STORE_REL");
|
||||
Builder.defineMacro("__BPF_FEATURE_GOTOX");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -70,6 +70,9 @@ int u;
|
||||
#ifdef __BPF_FEATURE_LOAD_ACQ_STORE_REL
|
||||
int v;
|
||||
#endif
|
||||
#ifdef __BPF_FEATURE_GOTOX
|
||||
int w;
|
||||
#endif
|
||||
|
||||
// CHECK: int b;
|
||||
// CHECK: int c;
|
||||
@@ -110,6 +113,7 @@ int v;
|
||||
// CPU_V4: int u;
|
||||
|
||||
// CPU_V4: int v;
|
||||
// CPU_V4: int w;
|
||||
|
||||
// CPU_GENERIC: int g;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user