[PATCH] Include popular std functions/classes into lld namespace.

Rui Ueyama ruiu at google.com
Fri Nov 22 11:20:57 PST 2013


Hi Bigcheese, shankarke, kledzik,

Here is a list of std::* sorted by number of occurrences. I'd think importing
the top five would make sense.

    390 std::unique_ptr
    191 std::vector
    127 std::move
    126 std::string
     25 std::map
     22 std::size_t
     15 std::pair
     15 std::memcpy
     14 std::forward
     13 std::bidirectional_iterator_tag

http://llvm-reviews.chandlerc.com/D2254

Files:
  include/lld/Core/LLVM.h

Index: include/lld/Core/LLVM.h
===================================================================
--- include/lld/Core/LLVM.h
+++ include/lld/Core/LLVM.h
@@ -20,7 +20,11 @@
 #include "llvm/ADT/Hashing.h"
 #include "llvm/Support/Casting.h"
 
+#include <map>
+#include <memory>
+#include <string>
 #include <utility>
+#include <vector>
 
 namespace llvm {
   // ADT's.
@@ -78,6 +82,13 @@
 
   using llvm::error_code;
   using llvm::raw_ostream;
+
+  // Standard library classes.
+  using std::map;
+  using std::move;
+  using std::string;
+  using std::unique_ptr;
+  using std::vector;
 } // end namespace clang.
 
 namespace std {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2254.1.patch
Type: text/x-patch
Size: 633 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131122/05a3d3ee/attachment.bin>


More information about the llvm-commits mailing list