[PATCH] D159137: [AIX] Fix Link Issue when `-fprofile-update=[atomic|prefer-atomic]` is in Effect

Qiongsi Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 29 13:51:13 PDT 2023


qiongsiwu1 added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/AIX.cpp:440
+      StringRef Val = A->getValue();
+      if (Val == "atomic" || Val == "prefer-atomic")
+        CmdArgs.push_back("-latomic");
----------------
This check here is copied from https://github.com/llvm/llvm-project/blob/77596e6b167bf0a5efa790597d6b75ac5e685b55/clang/lib/Driver/ToolChains/Clang.cpp#L867, and I don't think it is good to copy this particular code over because we are doing the same check twice at different places and the code can go out of sync. 

May I get some suggestions to avoid duplicating the code? Thanks! 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D159137



More information about the cfe-commits mailing list