[clang] [Clang] Add `-fdefault-generic-addrspace` flag for targeting GPUs (PR #115777)
Joseph Huber via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 11 14:33:42 PST 2024
================
@@ -1579,7 +1579,7 @@ NamedDecl *Sema::getCurFunctionOrMethodDecl() const {
}
LangAS Sema::getDefaultCXXMethodAddrSpace() const {
- if (getLangOpts().OpenCL)
+ if (getLangOpts().OpenCL || getLangOpts().OpenCLGenericAddressSpace)
----------------
jhuber6 wrote:
I think it's because the DefaultAS applies to every single language and it wasn't deemed proper to modify C/C++ behavior? I'm not an expert, maybe if @AnastasiaStulova chimes in. Regardless, I'm mostly just working with the smallest number of changes with what we've got that gives me the desired result.
https://github.com/llvm/llvm-project/pull/115777
More information about the cfe-commits
mailing list