Skip to content
Snippets Groups Projects
Commit 6927cf0c authored by Yonghong Song's avatar Yonghong Song
Browse files

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: default avatarYonghong Song <yhs@fb.com>
llvm-svn: 334839
parent 18ac8f9f
No related branches found
No related tags found
No related merge requests found
......@@ -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<bool> &Features, StringRef Name,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment