From: Yonghong Song Date: Fri, 23 Feb 2018 23:55:29 +0000 (+0000) Subject: bpf: Hook target feature "alu32" with LLVM X-Git-Tag: llvmorg-7.0.0-rc1~12078 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8b1e93b7d6171a693619288be6fe3c849ed18659;p=platform%2Fupstream%2Fllvm.git 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 Reviewed-by: Yonghong Song llvm-svn: 325996 --- diff --git a/clang/lib/Basic/Targets/BPF.h b/clang/lib/Basic/Targets/BPF.h index 836e475..36d2da4 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 &Features, StringRef Name, + bool Enabled) const override { + Features[Name] = Enabled; + } ArrayRef getTargetBuiltins() const override { return None; }