[PATCH] D137984: [BOLT] Fix state of MCSymbols in lowering pass

Rafael Auler via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 18 13:02:47 PST 2022


rafauler added inline comments.


================
Comment at: bolt/lib/Passes/BinaryPasses.cpp:599
+// already defined), clean it.
+void resetMCSymbolState(const MCExpr *Expr) {
+  if (const MCUnaryExpr *UE = dyn_cast<MCUnaryExpr>(Expr)) {
----------------
tschuett wrote:
> rafauler wrote:
> > tschuett wrote:
> > > `static`
> > this is under an anonymous namespace
> Exactly. You are supposed to use `static` instead of anonymous namespaces. It is about readability. If I look at `resetMCSymbolState`, then I cannot see that it has internal linkage. `static` makes the job simpler.
Oh, I didn't know/remember this rule changed in LLVM coding standards. Sounds good, thanks.

Ref for other readers: https://llvm.org/docs/CodingStandards.html#id58


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137984



More information about the llvm-commits mailing list