<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jan 20, 2014 at 7:19 AM, Rafael Espindola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: rafael<br>
Date: Mon Jan 20 09:19:43 2014<br>
New Revision: 199665<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=199665&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=199665&view=rev</a><br>
Log:<br>
Remove virtual methods that were added in 2009 and still had 1 implementation.<br>
<br>
Modified:<br>
cfe/trunk/include/clang/Basic/TargetInfo.h<br>
cfe/trunk/lib/CodeGen/CodeGenModule.cpp<br>
<br>
Modified: cfe/trunk/include/clang/Basic/TargetInfo.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TargetInfo.h?rev=199665&r1=199664&r2=199665&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TargetInfo.h?rev=199665&r1=199664&r2=199665&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/Basic/TargetInfo.h (original)<br>
+++ cfe/trunk/include/clang/Basic/TargetInfo.h Mon Jan 20 09:19:43 2014<br>
@@ -605,24 +605,6 @@ public:<br>
/// either; the entire thing is pretty badly mangled.<br>
virtual bool hasProtectedVisibility() const { return true; }<br>
<br>
- /// \brief Return the section to use for CFString literals, or 0 if no<br>
- /// special section is used.<br>
- virtual const char *getCFStringSection() const {<br>
- return "__DATA,__cfstring";<br>
- }<br>
-<br>
- /// \brief Return the section to use for NSString literals, or 0 if no<br>
- /// special section is used.<br>
- virtual const char *getNSStringSection() const {<br>
- return "__OBJC,__cstring_object,regular,no_dead_strip";<br>
- }<br>
-<br>
- /// \brief Return the section to use for NSString literals, or 0 if no<br>
- /// special section is used (NonFragile ABI).<br>
- virtual const char *getNSStringNonFragileABISection() const {<br>
- return "__DATA, __objc_stringobj, regular, no_dead_strip";<br>
- }<br>
-<br>
/// \brief An optional hook that targets can implement to perform semantic<br>
/// checking on attribute((section("foo"))) specifiers.<br>
///<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=199665&r1=199664&r2=199665&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=199665&r1=199664&r2=199665&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Mon Jan 20 09:19:43 2014<br>
@@ -2420,8 +2420,8 @@ CodeGenModule::GetAddrOfConstantCFString<br>
GV = new llvm::GlobalVariable(getModule(), C->getType(), true,<br>
llvm::GlobalVariable::PrivateLinkage, C,<br>
"_unnamed_cfstring_");<br>
- if (const char *Sect = getTarget().getCFStringSection())<br>
- GV->setSection(Sect);<br>
+ const char *CFStringSection = "__DATA,__cfstring";<br>
+ GV->setSection(CFStringSection);<br></blockquote><div><br></div><div>Does the named variable add anything here compared to just inlining it into the argument?<br><br>GV->setSection("__DATA,__cfstring");</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Entry.setValue(GV);<br>
<br>
return GV;<br>
@@ -2532,12 +2532,14 @@ CodeGenModule::GetAddrOfConstantString(c<br>
GV = new llvm::GlobalVariable(getModule(), C->getType(), true,<br>
llvm::GlobalVariable::PrivateLinkage, C,<br>
"_unnamed_nsstring_");<br>
+ const char *NSStringSection = "__OBJC,__cstring_object,regular,no_dead_strip";<br>
+ const char *NSStringNonFragileABISection =<br>
+ "__DATA, __objc_stringobj, regular, no_dead_strip";<br>
// FIXME. Fix section.<br>
- if (const char *Sect =<br>
- LangOpts.ObjCRuntime.isNonFragile()<br>
- ? getTarget().getNSStringNonFragileABISection()<br>
- : getTarget().getNSStringSection())<br>
- GV->setSection(Sect);<br>
+ const char *Sect = LangOpts.ObjCRuntime.isNonFragile()<br>
+ ? NSStringNonFragileABISection<br>
+ : NSStringSection;<br>
+ GV->setSection(Sect);<br></blockquote><div><br></div><div>I'd question it here too, though I realize the line might be a little unweildy rolled together (though "const char *Sect = " is actually more characters than "GV->setSection(" and doesn't add any more semantic information...)</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Entry.setValue(GV);<br>
<br>
return GV;<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div></div>