From: Yonghong Song Date: Fri, 15 Jun 2018 15:53:31 +0000 (+0000) Subject: bpf: recognize target specific option -mattr=dwarfris in clang X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=24e21d766f42fedad88b0a5b8db385bd3ca4ec56;p=clang bpf: recognize target specific option -mattr=dwarfris in clang The following is the usage example with clang: bash-4.2$ clang -target bpf -O2 -g -c -Xclang -target-feature -Xclang +dwarfris t.c bash-4.2$ llvm-objdump -S -d t.o t.o: file format ELF64-BPF Disassembly of section .text: test: ; int test(void) { 0: b7 00 00 00 00 00 00 00 r0 = 0 ; return 0; 1: 95 00 00 00 00 00 00 00 exit bash-4.2$ cat t.c int test(void) { return 0; } bash-4.2$ Signed-off-by: Yonghong Song git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@334839 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Basic/Targets/BPF.h b/lib/Basic/Targets/BPF.h index 61a7ddae9c..7f97f81891 100644 --- a/lib/Basic/Targets/BPF.h +++ b/lib/Basic/Targets/BPF.h @@ -47,7 +47,7 @@ public: MacroBuilder &Builder) const override; bool hasFeature(StringRef Feature) const override { - return Feature == "bpf" || Feature == "alu32"; + return Feature == "bpf" || Feature == "alu32" || Feature == "dwarfris"; } void setFeatureEnabled(llvm::StringMap &Features, StringRef Name,