jplehr added inline comments.

================
Comment at: llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp:4914
+  GVMode->setVisibility(llvm::GlobalVariable::ProtectedVisibility);
+  assert(!GVMode->isDeclaration() &&
+         "Only globals with definition can force usage.");
----------------
raghavendhra wrote:
> jplehr wrote:
> > Can this assertion ever be not be met? I'm just curious, given that you 
> > create that `GVMode` yourself.
> Adopted this assert from Clang Codegen addCompilerUsedGlobal() which is 
> called inside setPropertyExecutionMode() in CGOpenMPRuntimeGPU.cpp
> 
> Actual definition of addCompilerusedGlobal() in CodeGenModule.cpp
> 
> void CodeGenModule::addCompilerUsedGlobal(llvm::GlobalValue *GV) {
>   assert(!GV->isDeclaration() &&
>          "Only globals with definition can force usage.");
>   LLVMCompilerUsed.emplace_back(GV);
> }
Sorry for the confusion I potentially created: I mainly wanted to understand if 
that case can ever happen.
I'm not really familiar with this part of the compiler.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155794

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to