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

Chad Rosier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 4 08:30:38 PST 2017


mcrosier 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>;
----------------
Should this not be in the m_x86_Features_Group since this is an x86 specific flag?


================
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
----------------
I want to say this test should be in test/Frontend directory since you're testing a new CC1 option.


================
Comment at: test/CodeGen/fentry.c:11
+
+//HAS: attributes #{{[0-9]+}} = { {{.*}}"fentry-call"="true"{{.*}} }
+//NOHAS-NOT: attributes #{{[0-9]+}} = { {{.*}}"fentry-call"{{.*}} }
----------------
I'd prefer we stick with the default CHECK and CHECK-NOT prefixes.


https://reviews.llvm.org/D28001





More information about the cfe-commits mailing list