[PATCH] D28001: [X86] Teach Clang about -mfentry flag

Nirav Dave via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 10 12:28:49 PST 2017


niravd added inline comments.


================
Comment at: include/clang/Driver/Options.td:1731
 def mno_pie_copy_relocations : Flag<["-"], "mno-pie-copy-relocations">, Group<m_Group>;
+def mfentry : Flag<["-"], "mfentry">, HelpText<"insert calls to fentry at function entry">, Flags<[CC1Option]>, Group<m_Group>;
 def mx87 : Flag<["-"], "mx87">, Group<m_x86_Features_Group>;
----------------
mcrosier wrote:
> Should this not be in the m_x86_Features_Group since this is an x86 specific flag?
Done. -mfentry should eventually defined for at least aarch64 but until that point we should have the flag match clang's actual capabilities.


================
Comment at: test/CodeGen/fentry.c:1
+// RUN: %clang_cc1 -pg -mfentry -triple i386-unknown-unknown -emit-llvm -o - %s | FileCheck -check-prefix=HAS %s
+// RUN: %clang_cc1 -pg -mfentry -triple x86_64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck -check-prefix=HAS %s
----------------
mcrosier wrote:
> I want to say this test should be in test/Frontend directory since you're testing a new CC1 option.
That seems reasonable, but I wanted to match with the mcount test. 


https://reviews.llvm.org/D28001





More information about the cfe-commits mailing list