llvm::Constant *Zero = llvm::Constant::getNullValue(Int32Ty);
llvm::Constant *Zeros[] = { Zero, Zero };
-
+
// If we don't already have it, get __CFConstantStringClassReference.
if (!CFConstantStringClassRef) {
llvm::Type *Ty = getTypes().ConvertType(getContext().IntTy);
Ty = llvm::ArrayType::get(Ty, 0);
llvm::Constant *C =
CreateRuntimeVariable(Ty, "__CFConstantStringClassReference");
-
+
if (getTriple().isOSBinFormatELF() || getTriple().isOSBinFormatCOFF()) {
llvm::GlobalValue *GV = nullptr;
-
+
if ((GV = dyn_cast<llvm::GlobalValue>(C))) {
IdentifierInfo &II = getContext().Idents.get(GV->getName());
TranslationUnitDecl *TUDecl = getContext().getTranslationUnitDecl();
for (const auto &Result : DC->lookup(&II))
if ((VD = dyn_cast<VarDecl>(Result)))
break;
-
+
if (getTriple().isOSBinFormatELF()) {
if (!VD)
GV->setLinkage(llvm::GlobalValue::ExternalLinkage);
GV->setLinkage(llvm::GlobalValue::ExternalLinkage);
}
}
-
+
setDSOLocal(GV);
}
}
-
+
// Decay array -> ptr
CFConstantStringClassRef =
llvm::ConstantExpr::getGetElementPtr(Ty, C, Zeros);
// the static linker to adjust permissions to read-only later on.
else if (getTriple().isOSBinFormatELF())
GV->setSection(".rodata");
-
+
// String.
llvm::Constant *Str =
llvm::ConstantExpr::getGetElementPtr(GV->getValueType(), GV, Zeros);
case Decl::OMPDeclareReduction:
EmitOMPDeclareReduction(cast<OMPDeclareReductionDecl>(D));
break;
-
+
case Decl::OMPRequires:
EmitOMPRequiresDecl(cast<OMPRequiresDecl>(D));
break;