<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 29, 2016 at 12:47 PM, Eugene Zelenko via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: eugenezelenko<br>
Date: Fri Apr 29 14:47:09 2016<br>
New Revision: 268093<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=268093&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=268093&view=rev</a><br>
Log:<br>
Fix some Include What You Use warnings; other minor fixes.<br>
<br>
Differential revision: <a href="http://reviews.llvm.org/D19735" rel="noreferrer" target="_blank">http://reviews.llvm.org/D19735</a><br>
<br>
Modified:<br>
    lld/trunk/include/lld/Core/Simple.h<br>
    lld/trunk/lib/ReaderWriter/MachO/Atoms.h<br>
    lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp<br>
<br>
Modified: lld/trunk/include/lld/Core/Simple.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/Simple.h?rev=268093&r1=268092&r2=268093&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/Simple.h?rev=268093&r1=268092&r2=268093&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/include/lld/Core/Simple.h (original)<br>
+++ lld/trunk/include/lld/Core/Simple.h Fri Apr 29 14:47:09 2016<br>
@@ -15,14 +15,23 @@<br>
 #ifndef LLD_CORE_SIMPLE_H<br>
 #define LLD_CORE_SIMPLE_H<br>
<br>
+#include "lld/Core/AbsoluteAtom.h"<br>
+#include "lld/Core/Atom.h"<br>
 #include "lld/Core/DefinedAtom.h"<br>
 #include "lld/Core/File.h"<br>
-#include "lld/Core/LinkingContext.h"<br>
 #include "lld/Core/Reference.h"<br>
+#include "lld/Core/SharedLibraryAtom.h"<br>
 #include "lld/Core/UndefinedAtom.h"<br>
+#include "llvm/ADT/SmallVector.h"<br>
+#include "llvm/ADT/StringRef.h"<br>
 #include "llvm/ADT/ilist.h"<br>
-#include "llvm/ADT/ilist_node.h"<br>
-#include <atomic><br>
+#include "llvm/Support/Allocator.h"<br>
+#include "llvm/Support/Casting.h"<br>
+#include "llvm/Support/ErrorHandling.h"<br>
+#include <algorithm><br>
+#include <cassert><br>
+#include <cstdint><br>
+#include <functional><br>
<br>
 namespace lld {<br>
<br>
@@ -142,12 +151,13 @@ private:<br>
   SimpleReference *_prev;<br>
 };<br>
<br>
-}<br>
+} // end namespace lld<br></blockquote><div><br></div><div>Do we have any significantly prevailing style for end of namespace comments? (does the style guide say we should have them? Do we usually use "end blah" rather than just "blah", etc) - I'd be a bit surprised. & if we don't, I'd hesitate to do any cleanup like this.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
 // ilist will lazily create a sentinal (so end() can return a node past the<br>
 // end of the list). We need this trait so that the sentinal is allocated<br>
 // via the BumpPtrAllocator.<br>
 namespace llvm {<br>
+<br>
 template<><br>
 struct ilist_sentinel_traits<lld::SimpleReference> {<br>
<br>
@@ -183,7 +193,8 @@ struct ilist_sentinel_traits<lld::Simple<br>
 private:<br>
   mutable llvm::BumpPtrAllocator *_allocator;<br>
 };<br>
-}<br>
+<br>
+} // end namespace llvm<br>
<br>
 namespace lld {<br>
<br>
@@ -194,7 +205,7 @@ public:<br>
     _references.setAllocator(&f.allocator());<br>
   }<br>
<br>
-  ~SimpleDefinedAtom() {<br>
+  ~SimpleDefinedAtom() override {<br>
     _references.clearAndLeakNodesUnsafely();<br>
   }<br>
<br>
@@ -278,6 +289,7 @@ public:<br>
       _references.push_back(node);<br>
     }<br>
   }<br>
+<br>
   void setOrdinal(uint64_t ord) { _ordinal = ord; }<br>
<br>
 private:<br>
@@ -312,4 +324,4 @@ private:<br>
<br>
 } // end namespace lld<br>
<br>
-#endif<br>
+#endif // LLD_CORE_SIMPLE_H<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/MachO/Atoms.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/Atoms.h?rev=268093&r1=268092&r2=268093&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/Atoms.h?rev=268093&r1=268092&r2=268093&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/MachO/Atoms.h (original)<br>
+++ lld/trunk/lib/ReaderWriter/MachO/Atoms.h Fri Apr 29 14:47:09 2016<br>
@@ -1,4 +1,4 @@<br>
-//===- lib/ReaderWriter/MachO/Atoms.h -------------------------------------===//<br>
+//===- lib/ReaderWriter/MachO/Atoms.h ---------------------------*- C++ -*-===//<br>
 //<br>
 //                             The LLVM Linker<br>
 //<br>
@@ -10,10 +10,21 @@<br>
 #ifndef LLD_READER_WRITER_MACHO_ATOMS_H<br>
 #define LLD_READER_WRITER_MACHO_ATOMS_H<br>
<br>
+#include "lld/Core/Atom.h"<br>
+#include "lld/Core/DefinedAtom.h"<br>
+#include "lld/Core/SharedLibraryAtom.h"<br>
 #include "lld/Core/Simple.h"<br>
+#include "llvm/ADT/ArrayRef.h"<br>
+#include "llvm/ADT/StringRef.h"<br>
+#include <cstdint><br>
+#include <string><br>
<br>
 namespace lld {<br>
+<br>
+class File;<br>
+<br>
 namespace mach_o {<br>
+<br>
 class MachODefinedAtom : public SimpleDefinedAtom {<br>
 public:<br>
   MachODefinedAtom(const File &f, const StringRef name, Scope scope,<br>
@@ -164,7 +175,7 @@ private:<br>
   StringRef _dylibInstallName;<br>
 };<br>
<br>
-} // namespace mach_o<br>
-} // namespace lld<br>
+} // end namespace mach_o<br>
+} // end namespace lld<br>
<br>
 #endif // LLD_READER_WRITER_MACHO_ATOMS_H<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp?rev=268093&r1=268092&r2=268093&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp?rev=268093&r1=268092&r2=268093&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp (original)<br>
+++ lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp Fri Apr 29 14:47:09 2016<br>
@@ -7,31 +7,41 @@<br>
 //<br>
 //===----------------------------------------------------------------------===//<br>
<br>
+#include "lld/Core/AbsoluteAtom.h"<br>
 #include "lld/Core/ArchiveLibraryFile.h"<br>
+#include "lld/Core/Atom.h"<br>
 #include "lld/Core/DefinedAtom.h"<br>
 #include "lld/Core/Error.h"<br>
 #include "lld/Core/File.h"<br>
-#include "lld/Core/LLVM.h"<br>
+#include "lld/Core/LinkingContext.h"<br>
 #include "lld/Core/Reader.h"<br>
 #include "lld/Core/Reference.h"<br>
+#include "lld/Core/SharedLibraryAtom.h"<br>
 #include "lld/Core/Simple.h"<br>
+#include "lld/Core/UndefinedAtom.h"<br>
 #include "lld/Core/Writer.h"<br>
 #include "lld/ReaderWriter/YamlContext.h"<br>
 #include "llvm/ADT/ArrayRef.h"<br>
 #include "llvm/ADT/DenseMap.h"<br>
 #include "llvm/ADT/StringMap.h"<br>
+#include "llvm/ADT/StringRef.h"<br>
 #include "llvm/ADT/Twine.h"<br>
+#include "llvm/Support/Allocator.h"<br>
 #include "llvm/Support/Debug.h"<br>
-#include "llvm/Support/Errc.h"<br>
-#include "llvm/Support/ErrorHandling.h"<br>
+#include "llvm/Support/Error.h"<br>
+#include "llvm/Support/ErrorOr.h"<br>
+#include "llvm/Support/FileSystem.h"<br>
 #include "llvm/Support/Format.h"<br>
 #include "llvm/Support/MemoryBuffer.h"<br>
-#include "llvm/Support/Path.h"<br>
 #include "llvm/Support/YAMLTraits.h"<br>
 #include "llvm/Support/raw_ostream.h"<br>
+#include <cassert><br>
+#include <cstdint><br>
+#include <cstring><br>
 #include <memory><br>
 #include <string><br>
 #include <system_error><br>
+#include <vector><br>
<br>
 using llvm::yaml::MappingTraits;<br>
 using llvm::yaml::ScalarEnumerationTraits;<br>
@@ -233,7 +243,7 @@ struct RefKind {<br>
   Reference::KindValue      value;<br>
 };<br>
<br>
-} // anonymous namespace<br>
+} // end anonymous namespace<br>
<br>
 LLVM_YAML_IS_SEQUENCE_VECTOR(ArchMember)<br>
 LLVM_YAML_IS_SEQUENCE_VECTOR(const lld::Reference *)<br>
@@ -838,7 +848,9 @@ template <> struct MappingTraits<const l<br>
                                    << ", " << _name.size() << ")\n");<br>
       return this;<br>
     }<br>
+<br>
     void bind(const RefNameResolver &);<br>
+<br>
     // Extract current File object from YAML I/O parsing context<br>
     const lld::File &fileFromContext(IO &io) {<br>
       YamlContext *info = reinterpret_cast<YamlContext *>(io.getContext());<br>
@@ -1044,7 +1056,6 @@ template <> struct MappingTraits<lld::Un<br>
<br>
 // YAML conversion for const lld::SharedLibraryAtom*<br>
 template <> struct MappingTraits<const lld::SharedLibraryAtom *> {<br>
-<br>
   class NormalizedAtom : public lld::SharedLibraryAtom {<br>
   public:<br>
     NormalizedAtom(IO &io)<br>
@@ -1199,8 +1210,8 @@ template <> struct MappingTraits<lld::Ab<br>
   }<br>
 };<br>
<br>
-} // namespace llvm<br>
-} // namespace yaml<br>
+} // end namespace llvm<br>
+} // end namespace yaml<br>
<br>
 RefNameResolver::RefNameResolver(const lld::File *file, IO &io) : _io(io) {<br>
   typedef MappingTraits<const lld::DefinedAtom *>::NormalizedAtom<br>
@@ -1371,7 +1382,7 @@ private:<br>
   const Registry &_registry;<br>
 };<br>
<br>
-} // anonymous namespace<br>
+} // end anonymous namespace<br>
<br>
 void Registry::addSupportYamlFiles() {<br>
   add(std::unique_ptr<Reader>(new YAMLReader(*this)));<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>