[llvm] r202582 - [C++11] Remove the use of LLVM_HAS_RVALUE_REFERENCES from the rest of

Chandler Carruth chandlerc at gmail.com
Sat Mar 1 01:32:04 PST 2014


Author: chandlerc
Date: Sat Mar  1 03:32:03 2014
New Revision: 202582

URL: http://llvm.org/viewvc/llvm-project?rev=202582&view=rev
Log:
[C++11] Remove the use of LLVM_HAS_RVALUE_REFERENCES from the rest of
the core LLVM libraries.

Modified:
    llvm/trunk/include/llvm/Analysis/LazyCallGraph.h
    llvm/trunk/include/llvm/IR/PassManager.h
    llvm/trunk/lib/Analysis/LazyCallGraph.cpp

Modified: llvm/trunk/include/llvm/Analysis/LazyCallGraph.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LazyCallGraph.h?rev=202582&r1=202581&r2=202582&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/LazyCallGraph.h (original)
+++ llvm/trunk/include/llvm/Analysis/LazyCallGraph.h Sat Mar  1 03:32:03 2014
@@ -186,13 +186,11 @@ public:
   /// graph remains valid for the module. It is also relatively expensive.
   LazyCallGraph(const LazyCallGraph &G);
 
-#if LLVM_HAS_RVALUE_REFERENCES
   /// \brief Move constructor.
   ///
   /// This is a deep move. It leaves G in an undefined but destroyable state.
   /// Any other operation on G is likely to fail.
   LazyCallGraph(LazyCallGraph &&G);
-#endif
 
   iterator begin() { return iterator(*this, EntryNodes); }
   iterator end() { return iterator(*this, EntryNodes, iterator::IsAtEndT()); }
@@ -236,10 +234,8 @@ private:
   /// \brief Helper to copy a node from another graph into this one.
   Node *copyInto(const Node &OtherN);
 
-#if LLVM_HAS_RVALUE_REFERENCES
   /// \brief Helper to move a node from another graph into this one.
   Node *moveInto(Node &&OtherN);
-#endif
 };
 
 /// \brief A node in the call graph.
@@ -262,10 +258,8 @@ class LazyCallGraph::Node {
   /// \brief Constructor used when copying a node from one graph to another.
   Node(LazyCallGraph &G, const Node &OtherN);
 
-#if LLVM_HAS_RVALUE_REFERENCES
   /// \brief Constructor used when moving a node from one graph to another.
   Node(LazyCallGraph &G, Node &&OtherN);
-#endif
 
 public:
   typedef LazyCallGraph::iterator iterator;

Modified: llvm/trunk/include/llvm/IR/PassManager.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/PassManager.h?rev=202582&r1=202581&r2=202582&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/PassManager.h (original)
+++ llvm/trunk/include/llvm/IR/PassManager.h Sat Mar  1 03:32:03 2014
@@ -106,7 +106,6 @@ public:
         PreservedPassIDs.erase(*I);
   }
 
-#if LLVM_HAS_RVALUE_REFERENCES
   /// \brief Intersect this set with a temporary other set in place.
   ///
   /// This is a mutating operation on this preserved set, removing all
@@ -124,7 +123,6 @@ public:
       if (!Arg.PreservedPassIDs.count(*I))
         PreservedPassIDs.erase(*I);
   }
-#endif
 
   /// \brief Query whether a pass is marked as preserved by this set.
   template <typename PassT> bool preserved() const {

Modified: llvm/trunk/lib/Analysis/LazyCallGraph.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LazyCallGraph.cpp?rev=202582&r1=202581&r2=202582&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/LazyCallGraph.cpp (original)
+++ llvm/trunk/lib/Analysis/LazyCallGraph.cpp Sat Mar  1 03:32:03 2014
@@ -83,7 +83,6 @@ LazyCallGraph::Node::Node(LazyCallGraph
       Callees.push_back(G.copyInto(*OI->get<Node *>()));
 }
 
-#if LLVM_HAS_RVALUE_REFERENCES
 LazyCallGraph::Node::Node(LazyCallGraph &G, Node &&OtherN)
     : G(G), F(OtherN.F), Callees(std::move(OtherN.Callees)),
       CalleeSet(std::move(OtherN.CalleeSet)) {
@@ -94,7 +93,6 @@ LazyCallGraph::Node::Node(LazyCallGraph
     if (Node *ChildN = CI->dyn_cast<Node *>())
       *CI = G.moveInto(std::move(*ChildN));
 }
-#endif
 
 LazyCallGraph::LazyCallGraph(Module &M) : M(M) {
   for (Module::iterator FI = M.begin(), FE = M.end(); FI != FE; ++FI)
@@ -125,7 +123,6 @@ LazyCallGraph::LazyCallGraph(const LazyC
       EntryNodes.push_back(copyInto(*EI->get<Node *>()));
 }
 
-#if LLVM_HAS_RVALUE_REFERENCES
 // FIXME: This would be crazy simpler if BumpPtrAllocator were movable without
 // invalidating any of the allocated memory. We should make that be the case at
 // some point and delete this.
@@ -141,7 +138,6 @@ LazyCallGraph::LazyCallGraph(LazyCallGra
     if (Node *EntryN = EI->dyn_cast<Node *>())
       *EI = moveInto(std::move(*EntryN));
 }
-#endif
 
 LazyCallGraph::Node *LazyCallGraph::insertInto(Function &F, Node *&MappedN) {
   return new (MappedN = BPA.Allocate()) Node(*this, F);
@@ -155,7 +151,6 @@ LazyCallGraph::Node *LazyCallGraph::copy
   return new (N = BPA.Allocate()) Node(*this, OtherN);
 }
 
-#if LLVM_HAS_RVALUE_REFERENCES
 LazyCallGraph::Node *LazyCallGraph::moveInto(Node &&OtherN) {
   Node *&N = NodeMap[&OtherN.F];
   if (N)
@@ -163,7 +158,6 @@ LazyCallGraph::Node *LazyCallGraph::move
 
   return new (N = BPA.Allocate()) Node(*this, std::move(OtherN));
 }
-#endif
 
 char LazyCallGraphAnalysis::PassID;
 





More information about the llvm-commits mailing list