return Error::success();
}
+static void inferDSOLocal(GlobalValue *GV) {
+ // infer dso_local from linkage and visibility if it is not encoded.
+ if (GV->hasLocalLinkage() ||
+ (!GV->hasDefaultVisibility() && !GV->hasExternalWeakLinkage()))
+ GV->setDSOLocal(true);
+}
+
Error BitcodeReader::parseGlobalVarRecord(ArrayRef<uint64_t> Record) {
// v1: [pointer type, isconst, initid, linkage, alignment, section,
// visibility, threadlocal, unnamed_addr, externally_initialized,
if (Record.size() > 13) {
NewGV->setDSOLocal(getDecodedDSOLocal(Record[13]));
}
+ inferDSOLocal(NewGV);
return Error::success();
}
if (Record.size() > 15) {
Func->setDSOLocal(getDecodedDSOLocal(Record[15]));
}
+ inferDSOLocal(Func);
ValueList.push_back(Func);
}
if (OpNum != Record.size())
NewGA->setDSOLocal(getDecodedDSOLocal(Record[OpNum++]));
+ inferDSOLocal(NewGA);
+
ValueList.push_back(NewGA);
IndirectSymbolInits.push_back(std::make_pair(NewGA, Val));
return Error::success();