llvm.org GIT mirror llvm / 8598e29
GlobalValue: Automatically reset visibility when setting local linkage r208264 started asserting in `setLinkage()` and `setVisibility()` that visibility and linkage are compatible. There are a few places in clang where visibility is set first, and then linkage later, so the assert fires. In `setLinkage()`, it's clear what the visibility *should* be, so rather than updating all the call sites just automatically fix the visibility. The testcase for this is for *clang*, so it'll follow separately in cfe. PR19760 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209227 91177308-0d34-0410-b5e6-96231b3b80d8 Duncan P. N. Exon Smith 6 years ago
1 changed file(s) with 2 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
221221 bool hasCommonLinkage() const { return isCommonLinkage(Linkage); }
222222
223223 void setLinkage(LinkageTypes LT) {
224 assert((!isLocalLinkage(LT) || hasDefaultVisibility()) &&
225 "local linkage requires default visibility");
224 if (isLocalLinkage(LT))
225 Visibility = DefaultVisibility;
226226 Linkage = LT;
227227 }
228228 LinkageTypes getLinkage() const { return Linkage; }