summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGObjCMac.cpp
diff options
context:
space:
mode:
authorMichael Gottesman <mgottesman@apple.com>2013-02-05 23:08:45 +0000
committerMichael Gottesman <mgottesman@apple.com>2013-02-05 23:08:45 +0000
commit5c2059603ca3769465de5ea0465ad83bdf2f7dd9 (patch)
tree48b5e3546ffcc87c90edcc1410d18e279818ab31 /clang/lib/CodeGen/CGObjCMac.cpp
parent5dba16c58133eebe8c25832b3d9889f670170da1 (diff)
downloadbcm5719-llvm-5c2059603ca3769465de5ea0465ad83bdf2f7dd9.tar.gz
bcm5719-llvm-5c2059603ca3769465de5ea0465ad83bdf2f7dd9.zip
Changed CGObjCMac.cpp to add the marker externally_initialized to SELECTOR_REFERENCES in both the fragile and non-fragile API.
This is to ensure that GlobalOpt in LLVM does not attempt to look through a selector reference to a method var name at compile time. I also added a test/updated old tests that need to recognize the new keyword. rdar://12580965. llvm-svn: 174461
Diffstat (limited to 'clang/lib/CodeGen/CGObjCMac.cpp')
-rw-r--r--clang/lib/CodeGen/CGObjCMac.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp
index 5ce6cd0ce5b..2d67a77cfaa 100644
--- a/clang/lib/CodeGen/CGObjCMac.cpp
+++ b/clang/lib/CodeGen/CGObjCMac.cpp
@@ -4415,6 +4415,7 @@ llvm::Value *CGObjCMac::EmitSelector(CGBuilderTy &Builder, Selector Sel,
CreateMetadataVar("\01L_OBJC_SELECTOR_REFERENCES_", Casted,
"__OBJC,__message_refs,literal_pointers,no_dead_strip",
4, true);
+ Entry->setExternallyInitialized(true);
}
if (lvalue)
@@ -6761,6 +6762,7 @@ llvm::Value *CGObjCNonFragileABIMac::EmitSelector(CGBuilderTy &Builder,
new llvm::GlobalVariable(CGM.getModule(), ObjCTypes.SelectorPtrTy, false,
llvm::GlobalValue::InternalLinkage,
Casted, "\01L_OBJC_SELECTOR_REFERENCES_");
+ Entry->setExternallyInitialized(true);
Entry->setSection("__DATA, __objc_selrefs, literal_pointers, no_dead_strip");
CGM.AddUsedGlobal(Entry);
}
OpenPOWER on IntegriCloud