}
void CGOpenMPRuntimeNVPTX::clear() {
+ if (CGDebugInfo *DI = CGM.getModuleDebugInfo())
+ if (CGM.getCodeGenOpts().getDebugInfo() >=
+ codegenoptions::LimitedDebugInfo) {
+ ASTContext &C = CGM.getContext();
+ auto *VD = VarDecl::Create(
+ C, C.getTranslationUnitDecl(), SourceLocation(), SourceLocation(),
+ &C.Idents.get("_$_"), C.IntTy, /*TInfo=*/nullptr, SC_Static);
+ auto *Var = cast<llvm::GlobalVariable>(
+ CGM.CreateRuntimeVariable(CGM.IntTy, "_$_"));
+ Var->setInitializer(llvm::ConstantInt::getNullValue(CGM.IntTy));
+ Var->setLinkage(llvm::GlobalVariable::CommonLinkage);
+ CGM.addCompilerUsedGlobal(Var);
+ DI->EmitGlobalVariable(Var, VD);
+ }
if (!GlobalizedRecords.empty()) {
ASTContext &C = CGM.getContext();
llvm::SmallVector<const GlobalPtrSizeRecsTy *, 4> GlobalRecs;
// TCHECK: [[TT:%.+]] = type { i64, i8 }
// TCHECK: [[S1:%.+]] = type { double }
+// TCHECK: @{{.*}}_$_{{.*}} = common global i32 0, !dbg !{{[0-9]+}}
int foo(int n, double *ptr) {
int a = 0;
short aa = 0;