[clang] Disallow fbasic-block-sections on non-ELF, non-x86 targets.
authorSnehasish Kumar <snehasishk@google.com>
Thu, 10 Sep 2020 00:57:03 +0000 (17:57 -0700)
committerSnehasish Kumar <snehasishk@google.com>
Thu, 10 Sep 2020 07:15:33 +0000 (00:15 -0700)
commit157cd93b48a90f484e9eb2ed9997e0372b9c7ebb
treee07a5dea01a76975136e9afb8a3172c27ac32f3b
parentfea175b59fbdf5d2b95e8fd81ac043479f20fe10
[clang] Disallow fbasic-block-sections on non-ELF, non-x86 targets.

Basic block sections is untested on other platforms and binary formats apart
from x86,elf. This patch emits a warning and drops the flag if the platform
and binary format are not compatible. Add a test to ensure that
specifying an incompatible target in the driver does not enable the
feature.

Differential Revision: https://reviews.llvm.org/D87426
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/fbasic-block-sections.c