[PATCH] D125904: [Cuda] Use fallback method to mangle externalized decls if no CUID given

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 24 09:20:19 PDT 2022


yaxunl added inline comments.


================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:6845-6846
+    llvm::MD5::MD5Result Result;
+    for (const auto &Arg : PreprocessorOpts.Macros)
+      Hash.update(Arg.first);
+    Hash.final(Result);
----------------
jhuber6 wrote:
> yaxunl wrote:
> > Are these options always the same for device and host compilation?
> > 
> > If not, this may not work since host and device compilation will have different names for the same variable.
> This should only be definitions passed to the front-end via `-D`. There's a handful of these that the Clang driver will pass in, e.g. `-D__GCC_HAVE_DWARF2_CFI_ASM=1`, but as far as I know it's consistent between host and device compilations.
Can we add a comment here saying that this requires that device offloading toolchain does not add preprocessor arguments to clang? This is a hidden requirement.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125904



More information about the cfe-commits mailing list