[PATCH] D137753: [Clang][AIX][p]Enable -p Functionality

Michael Francis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 25 11:04:30 PST 2023


francii added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/AIX.cpp:274
 
-    if (Args.hasArg(options::OPT_pg)) {
+    if (Args.hasArg(options::OPT_p, options::OPT_pg)) {
       CmdArgs.push_back(Args.MakeArgString((llvm::Twine("-L") + D.SysRoot) +
----------------
daltenty wrote:
> Maybe I'm a bit confused, I though these options had different handling with respect to the paths? Otherwise, it's simply an alias.
You may be referring to lines 167-175 of this same file:
```
  auto getCrt0Basename = [&Args, IsArch32Bit] {
    // Enable gprofiling when "-pg" is specified.
    if (Args.hasArg(options::OPT_pg))
      return IsArch32Bit ? "gcrt0.o" : "gcrt0_64.o";
    // Enable profiling when "-p" is specified.
    else if (Args.hasArg(options::OPT_p))
      return IsArch32Bit ? "mcrt0.o" : "mcrt0_64.o";
    else
      return IsArch32Bit ? "crt0.o" : "crt0_64.o";
  };
```
This is the only time we handle `-p` differently. With both `-p` and `-pg`, we want to link the profiled libraries.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137753/new/

https://reviews.llvm.org/D137753



More information about the cfe-commits mailing list