[PATCH] D130426: [CodeGen] Fixed ambiguous symbol ExtAddrMode in case of NDEBUG and LLVM_ENABLE_DUMP

Dmitry Vassiliev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 23 11:53:57 PDT 2022


slydiman added inline comments.


================
Comment at: llvm/lib/CodeGen/CodeGenPrepare.cpp:2618
 
+} // end anonymous namespace
+
----------------
barannikov88 wrote:
> slydiman wrote:
> > barannikov88 wrote:
> > > Please refer to [[ https://llvm.org/docs/CodingStandards.html#anonymous-namespaces | the coding style ]], in particular:
> > > > Because of this, we have a simple guideline: make anonymous namespaces as small as possible, and only use them for class declarations.
> > > 
> > It seems the function void ExtAddrMode::print() is related to the struct ExtAddrMode declared above inside the anonymous namespace.
> > Please correct me if I'm wrong. Do you have any suggestions how to fix this error other way?
> `print` is defined under `#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)`.
> It should be declared under the same macros. Same for `dump`.
> 
> As for the error, it seems that it is picking ExtAddrMode from TargetInstrInfo.h somehow (note that it says 'print': is not a member of '**llvm::**ExtAddrMode',) though I could not find where this header is included. Are you sure you don't have any local changes that may trigger the issue?
> 
I have no any changes. Just defined NDEBUG and LLVM_ENABLE_DUMP.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130426



More information about the llvm-commits mailing list