<div dir="ltr">I've reverted this thusly:<div><br></div><div><div>echristo@dzur ~/s/llvm> git svn dcommit</div><div>Committing to <a href="https://llvm.org/svn/llvm-project/llvm/trunk">https://llvm.org/svn/llvm-project/llvm/trunk</a> ...</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>M<span class="Apple-tab-span" style="white-space:pre"> </span>lib/CodeGen/TargetLoweringObjectFileImpl.cpp</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>M<span class="Apple-tab-span" style="white-space:pre"> </span>lib/Target/TargetMachine.cpp</div><div>Committed r284252</div></div><div><br></div><div>since it was causing ubsan objections.</div><div><br></div><div>-eric</div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Oct 13, 2016 at 10:56 PM Eric Christopher via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: echristo<br class="gmail_msg">
Date: Fri Oct 14 00:47:41 2016<br class="gmail_msg">
New Revision: 284203<br class="gmail_msg">
<br class="gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=284203&view=rev" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project?rev=284203&view=rev</a><br class="gmail_msg">
Log:<br class="gmail_msg">
In preparation for removing getNameWithPrefix off of TargetMachine,<br class="gmail_msg">
sink the current behavior into the callers and sink<br class="gmail_msg">
TargetMachine::getNameWithPrefix into TargetMachine::getSymbol.<br class="gmail_msg">
<br class="gmail_msg">
Modified:<br class="gmail_msg">
llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp<br class="gmail_msg">
llvm/trunk/lib/Target/TargetMachine.cpp<br class="gmail_msg">
<br class="gmail_msg">
Modified: llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp<br class="gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp?rev=284203&r1=284202&r2=284203&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp?rev=284203&r1=284202&r2=284203&view=diff</a><br class="gmail_msg">
==============================================================================<br class="gmail_msg">
--- llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp (original)<br class="gmail_msg">
+++ llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp Fri Oct 14 00:47:41 2016<br class="gmail_msg">
@@ -301,7 +301,7 @@ selectELFSectionForGlobal(MCContext &Ctx<br class="gmail_msg">
<br class="gmail_msg">
if (EmitUniqueSection && UniqueSectionNames) {<br class="gmail_msg">
Name.push_back('.');<br class="gmail_msg">
- TM.getNameWithPrefix(Name, GV, Mang, true);<br class="gmail_msg">
+ Mang.getNameWithPrefix(Name, GV, false);<br class="gmail_msg">
}<br class="gmail_msg">
unsigned UniqueID = MCContext::GenericSectionID;<br class="gmail_msg">
if (EmitUniqueSection && !UniqueSectionNames) {<br class="gmail_msg">
@@ -817,6 +817,13 @@ static bool canUsePrivateLabel(const MCA<br class="gmail_msg">
void TargetLoweringObjectFileMachO::getNameWithPrefix(<br class="gmail_msg">
SmallVectorImpl<char> &OutName, const GlobalValue *GV,<br class="gmail_msg">
const TargetMachine &TM) const {<br class="gmail_msg">
+ if (!GV->hasPrivateLinkage()) {<br class="gmail_msg">
+ // Simple case: If GV is not private, it is not important to find out if<br class="gmail_msg">
+ // private labels are legal in this case or not.<br class="gmail_msg">
+ getMangler().getNameWithPrefix(OutName, GV, false);<br class="gmail_msg">
+ return;<br class="gmail_msg">
+ }<br class="gmail_msg">
+<br class="gmail_msg">
SectionKind GVKind = TargetLoweringObjectFile::getKindForGlobal(GV, TM);<br class="gmail_msg">
const MCSection *TheSection = SectionForGlobal(GV, GVKind, TM);<br class="gmail_msg">
bool CannotUsePrivateLabel =<br class="gmail_msg">
<br class="gmail_msg">
Modified: llvm/trunk/lib/Target/TargetMachine.cpp<br class="gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetMachine.cpp?rev=284203&r1=284202&r2=284203&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetMachine.cpp?rev=284203&r1=284202&r2=284203&view=diff</a><br class="gmail_msg">
==============================================================================<br class="gmail_msg">
--- llvm/trunk/lib/Target/TargetMachine.cpp (original)<br class="gmail_msg">
+++ llvm/trunk/lib/Target/TargetMachine.cpp Fri Oct 14 00:47:41 2016<br class="gmail_msg">
@@ -203,19 +203,13 @@ TargetIRAnalysis TargetMachine::getTarge<br class="gmail_msg">
void TargetMachine::getNameWithPrefix(SmallVectorImpl<char> &Name,<br class="gmail_msg">
const GlobalValue *GV, Mangler &Mang,<br class="gmail_msg">
bool MayAlwaysUsePrivate) const {<br class="gmail_msg">
- if (MayAlwaysUsePrivate || !GV->hasPrivateLinkage()) {<br class="gmail_msg">
- // Simple case: If GV is not private, it is not important to find out if<br class="gmail_msg">
- // private labels are legal in this case or not.<br class="gmail_msg">
- Mang.getNameWithPrefix(Name, GV, false);<br class="gmail_msg">
- return;<br class="gmail_msg">
- }<br class="gmail_msg">
const TargetLoweringObjectFile *TLOF = getObjFileLowering();<br class="gmail_msg">
TLOF->getNameWithPrefix(Name, GV, *this);<br class="gmail_msg">
}<br class="gmail_msg">
<br class="gmail_msg">
MCSymbol *TargetMachine::getSymbol(const GlobalValue *GV, Mangler &Mang) const {<br class="gmail_msg">
SmallString<128> NameStr;<br class="gmail_msg">
- getNameWithPrefix(NameStr, GV, Mang);<br class="gmail_msg">
const TargetLoweringObjectFile *TLOF = getObjFileLowering();<br class="gmail_msg">
+ TLOF->getNameWithPrefix(NameStr, GV, *this);<br class="gmail_msg">
return TLOF->getContext().getOrCreateSymbol(NameStr);<br class="gmail_msg">
}<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
llvm-commits mailing list<br class="gmail_msg">
<a href="mailto:llvm-commits@lists.llvm.org" class="gmail_msg" target="_blank">llvm-commits@lists.llvm.org</a><br class="gmail_msg">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br class="gmail_msg">
</blockquote></div>