[PATCH] D122760: [OpenMP] Add OpenMP variant extension to keep the unmangled name

Johannes Doerfert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 5 12:56:13 PDT 2022

jdoerfert added inline comments.

Comment at: clang/lib/CodeGen/CodeGenModule.cpp:3062
+    if (auto *A = Global->getAttr<OMPDeclareVariantNoMangleAttr>())
+      VariantGlobalsEmitted.insert(A->getFunction());
jhuber6 wrote:
> jdoerfert wrote:
> > This looks like you now disable the diagnostic for pretty much everything, no?
> This should only get called if we plan to emit this global, if the global has the attribute stating that it should not be mangled we're basically just asserting that its associated non-variant declaration should not be found. So even if we hit a name mangling conflict, as long as we haven't tried to emit that global we should be fine. I can add a test for this.
We only put things in this set for a special OpenMP case, correct?
The error condition below triggers only if something is in this set.

So all non-openmp codes will never see this diagnostic, or what am I missing?

  rG LLVM Github Monorepo



More information about the cfe-commits mailing list