<div dir="ltr">LGTM</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jun 19, 2013 at 9:27 PM, Shankar Easwaran <span dir="ltr"><<a href="mailto:shankare@codeaurora.org" target="_blank">shankare@codeaurora.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: shankare<br>
Date: Wed Jun 19 23:27:21 2013<br>
New Revision: 184398<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=184398&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=184398&view=rev</a><br>
Log:<br>
[TargetInfo] Undefined symbols move from ELFTargetInfo to TargetInfo<br>
<br>
This change moves the functionality of undefinedSymbols that were created in<br>
ELFTargetInfo into TargetInfo. Looks like MachO/Windows use similiar options<br>
like in ELF for creating undefined symbols when the linker is invoked.<br>
<br>
Address comment from Ruiu.<br>
<br>
(No change in functionality, except moving the functionality from ELF to<br>
TargetInfo, so that multiple architectures can use the same)<br>
<br>
Modified:<br>
    lld/trunk/include/lld/Core/TargetInfo.h<br>
    lld/trunk/include/lld/ReaderWriter/ELFTargetInfo.h<br>
<br>
Modified: lld/trunk/include/lld/Core/TargetInfo.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/TargetInfo.h?rev=184398&r1=184397&r2=184398&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/TargetInfo.h?rev=184398&r1=184397&r2=184398&view=diff</a><br>


==============================================================================<br>
--- lld/trunk/include/lld/Core/TargetInfo.h (original)<br>
+++ lld/trunk/include/lld/Core/TargetInfo.h Wed Jun 19 23:27:21 2013<br>
@@ -12,6 +12,7 @@<br>
<br>
 #include "lld/Core/Error.h"<br>
 #include "lld/Core/LLVM.h"<br>
+#include "lld/Core/range.h"<br>
 #include "lld/Core/Reference.h"<br>
<br>
 #include "lld/Driver/LinkerInput.h"<br>
@@ -237,6 +238,24 @@ public:<br>
     _llvmOptions.push_back(opt);<br>
   }<br>
<br>
+  /// This method adds undefined symbols specified by the -u option to the<br>
+  /// to the list of undefined symbols known to the linker. This option<br>
+  /// essentially forces an undefined symbol to be create.<br>
+  void addUndefinedSymbol(StringRef symbolName) {<br>
+    _undefinedSymbols.push_back(symbolName);<br>
+  }<br>
+<br>
+  /// Iterators for symbols that appear on the command line<br>
+  typedef std::vector<StringRef> StringRefVector;<br>
+  typedef StringRefVector::iterator StringRefVectorIter;<br>
+  typedef StringRefVector::const_iterator StringRefVectorConstIter;<br>
+<br>
+  /// Return the list of undefined symbols that are specified in the<br>
+  /// linker command line, using the -u option.<br>
+  range<const StringRef *> undefinedSymbols() const {<br>
+    return _undefinedSymbols;<br>
+  }<br>
+<br>
   /// After all set* methods are called, the Driver calls this method<br>
   /// to validate that there are no missing options or invalid combinations<br>
   /// of options.  If there is a problem, a description of the problem<br>
@@ -340,6 +359,7 @@ protected:<br>
   std::vector<LinkerInput> _inputFiles;<br>
   std::vector<const char*> _llvmOptions;<br>
   std::unique_ptr<Reader>  _yamlReader;<br>
+  StringRefVector          _undefinedSymbols;<br>
<br>
  private:<br>
   /// Validate the subclass bits. Only called by validate.<br>
<br>
Modified: lld/trunk/include/lld/ReaderWriter/ELFTargetInfo.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/ReaderWriter/ELFTargetInfo.h?rev=184398&r1=184397&r2=184398&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/ReaderWriter/ELFTargetInfo.h?rev=184398&r1=184397&r2=184398&view=diff</a><br>


==============================================================================<br>
--- lld/trunk/include/lld/ReaderWriter/ELFTargetInfo.h (original)<br>
+++ lld/trunk/include/lld/ReaderWriter/ELFTargetInfo.h Wed Jun 19 23:27:21 2013<br>
@@ -12,7 +12,6 @@<br>
<br>
 #include "lld/Core/PassManager.h"<br>
 #include "lld/Core/Pass.h"<br>
-#include "lld/Core/range.h"<br>
 #include "lld/Core/TargetInfo.h"<br>
 #include "lld/ReaderWriter/Reader.h"<br>
 #include "lld/ReaderWriter/Writer.h"<br>
@@ -155,22 +154,6 @@ public:<br>
   /// Searches directories then calls appendInputFile()<br>
   bool appendLibrary(StringRef libName);<br>
<br>
-  /// adds undefined symbols that are specified in the command line<br>
-  void addUndefinedSymbol(StringRef symbolName) {<br>
-    _undefinedSymbols.push_back(symbolName);<br>
-  }<br>
-<br>
-  /// Iterators for symbols that appear on the command line<br>
-  typedef std::vector<StringRef> StringRefVector;<br>
-  typedef StringRefVector::iterator StringRefVectorIter;<br>
-  typedef StringRefVector::const_iterator StringRefVectorConstIter;<br>
-<br>
-  /// Return the list of undefined symbols that are specified in the<br>
-  /// linker command line, using the -u option.<br>
-  range<const StringRef *> undefinedSymbols() const {<br>
-    return _undefinedSymbols;<br>
-  }<br>
-<br>
 private:<br>
   ELFTargetInfo() LLVM_DELETED_FUNCTION;<br>
 protected:<br>
@@ -197,7 +180,6 @@ protected:<br>
   std::unique_ptr<Writer>            _writer;<br>
   std::unique_ptr<Reader>            _linkerScriptReader;<br>
   StringRef                          _dynamicLinkerPath;<br>
-  StringRefVector                    _undefinedSymbols;<br>
 };<br>
 } // end namespace lld<br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>