diff options
| author | Yonghong Song <yhs@fb.com> | 2018-02-23 23:55:29 +0000 |
|---|---|---|
| committer | Yonghong Song <yhs@fb.com> | 2018-02-23 23:55:29 +0000 |
| commit | 8b1e93b7d6171a693619288be6fe3c849ed18659 (patch) | |
| tree | 900df8ea69710dc86a953fffe86e77db1f705394 /clang/lib/Basic | |
| parent | b9704c001cdfd55c4e4b17ac5ec849dd20486c15 (diff) | |
| download | bcm5719-llvm-8b1e93b7d6171a693619288be6fe3c849ed18659.tar.gz bcm5719-llvm-8b1e93b7d6171a693619288be6fe3c849ed18659.zip | |
bpf: Hook target feature "alu32" with LLVM
LLVM has supported a new target feature "alu32" which could be enabled or
disabled by "-mattr=[+|-]alu32" when using llc.
This patch link Clang with it, so it could be also done by passing related
options to Clang, for example:
-Xclang -target-feature -Xclang +alu32
Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Yonghong Song <yhs@fb.com>
llvm-svn: 325996
Diffstat (limited to 'clang/lib/Basic')
| -rw-r--r-- | clang/lib/Basic/Targets/BPF.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/lib/Basic/Targets/BPF.h b/clang/lib/Basic/Targets/BPF.h index 836e47554bc..36d2da4dbf3 100644 --- a/clang/lib/Basic/Targets/BPF.h +++ b/clang/lib/Basic/Targets/BPF.h @@ -46,7 +46,14 @@ public: void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override; - bool hasFeature(StringRef Feature) const override { return Feature == "bpf"; } + bool hasFeature(StringRef Feature) const override { + return Feature == "bpf" || Feature == "alu32"; + } + + void setFeatureEnabled(llvm::StringMap<bool> &Features, StringRef Name, + bool Enabled) const override { + Features[Name] = Enabled; + } ArrayRef<Builtin::Info> getTargetBuiltins() const override { return None; } |

