<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Nov 24, 2007, at 1:13 PM, Oliver Hunt wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">This patch adds support for sharing literal C strings<br><span><shared-cstrings.patch></span><br></blockquote></div><br><div>Looks great, some minor funkiness in indentation here:</div><div><br class="webkit-block-placeholder"></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">+/// CodeGenModule::GetAddrOfConstantString -- returns a pointer to the first </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">+/// element of a character array containing the literal.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">+llvm::Constant *CodeGenModule::GetAddrOfConstantString(const std::string &str) {</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">+    llvm::StringMapEntry<llvm::Constant *> &Entry = </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">+    ConstantStringMap.GetOrCreateValue(&str[0], &str[str.length()]);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">+    </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">+    if (Entry.getValue())</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">+        return Entry.getValue();</div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br class="webkit-block-placeholder"></span></font></div><div><span class="Apple-style-span" style="font-family: Monaco; font-size: 10px; ">It looks like you switched to indent-by-4 instead of indent-by-2.</span></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br class="webkit-block-placeholder"></span></font></div><div><br></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;">Another thing to consider: do you want to add -fwritable-strings support while you're at it?  This basically has two effects: 1) don't ever share strings, and 2) don't mark the generated globalvariable as constant.</span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br class="webkit-block-placeholder"></span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;">-Chris</span></font></div>
</div></body></html>