[cfe-dev] -p as an alias for -pg?

Jonathan Gray jsg at goblin.cx
Sat Dec 17 22:24:12 PST 2011


So it isn't clear if -p should be an alias of -pg everywhere
or if it should be target specific.  With gcc on OpenBSD
-p and -pg are the same.  But it seems on sysv unices,
-p is for prof/mon.out instead of gprof/gmon.out formats,
or was historically.

It isn't entirely obvious how to add an alias after the
command is already added via TableGen.  So if the following
isn't the way to go can someone give hints on how to
do it in a way that is target specific?

Index: include/clang/Driver/Options.td
===================================================================
--- include/clang/Driver/Options.td	(revision 146836)
+++ include/clang/Driver/Options.td	(working copy)
@@ -690,7 +690,7 @@
 def private__bundle : Flag<"-private_bundle">;
 def pthreads : Flag<"-pthreads">;
 def pthread : Flag<"-pthread">;
-def p : Flag<"-p">;
+def p : Flag<"-p">, Alias<pg>;
 def pie : Flag<"-pie">;
 def read__only__relocs : Separate<"-read_only_relocs">;
 def remap : Flag<"-remap">;



More information about the cfe-dev mailing list