]> granicus.if.org Git - clang/commit
bpf: add -mcpu=# support for bpf
authorYonghong Song <yhs@fb.com>
Wed, 23 Aug 2017 04:26:17 +0000 (04:26 +0000)
committerYonghong Song <yhs@fb.com>
Wed, 23 Aug 2017 04:26:17 +0000 (04:26 +0000)
commitd9a1cb6ba502c424fc7813d28a49c2831b094ec2
tree43fe2aaed741f4f72a2c2f767e410dfa3a0ba40f
parentce3349f4d78770e87d6ba4fd5ebd644a073b0aab
bpf: add -mcpu=# support for bpf

-mcpu=# will support:
  . generic: the default insn set
  . v1: insn set version 1, the same as generic
  . v2: insn set version 2, version 1 + additional jmp insns
  . probe: the compiler will probe the underlying kernel to
           decide proper version of insn set.

Examples:
$ clang -target bpf -mcpu=v1 -c t.c
$ clang -target bpf -mcpu=v2 -c t.c
$ clang -target bpf -mcpu=generic -c t.c
$ clang -target bpf -mcpu=probe -c t.c
$ clang -target bpf -mcpu=v3 -c t.c
error: unknown target CPU 'v3'

Signed-off-by: Yonghong Song <yhs@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311523 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Basic/Targets/BPF.h
lib/Driver/ToolChains/CommonArgs.cpp