Give CaptureTracker::shouldExplore a base implementation. Most users want to do
authorNick Lewycky <nicholas@mxc.ca>
Mon, 8 Oct 2012 22:12:48 +0000 (22:12 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Mon, 8 Oct 2012 22:12:48 +0000 (22:12 +0000)
the same thing. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165435 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/CaptureTracking.h
lib/Analysis/CaptureTracking.cpp
lib/Transforms/IPO/FunctionAttrs.cpp

index 9b5e8425ad29df36b1b2653e425aa4063468c658..2889269b957a08a8bed6b4386ad3741f92682f59 100644 (file)
@@ -46,7 +46,7 @@ namespace llvm {
     /// capture) return false. To search it, return true.
     ///
     /// U->getUser() is always an Instruction.
-    virtual bool shouldExplore(Use *U) = 0;
+    virtual bool shouldExplore(Use *U);
 
     /// captured - Information about the pointer was captured by the user of
     /// use U. Return true to stop the traversal or false to continue looking
index 974b906b34ec9ad1c6c54c8906e87f36159ddade..d9c02990a80125480bdd3bae75c5d6a98aec0334 100644 (file)
@@ -23,6 +23,8 @@ using namespace llvm;
 
 CaptureTracker::~CaptureTracker() {}
 
+bool CaptureTracker::shouldExplore(Use *U) { return true; }
+
 namespace {
   struct SimpleCaptureTracker : public CaptureTracker {
     explicit SimpleCaptureTracker(bool ReturnCaptures)
@@ -30,8 +32,6 @@ namespace {
 
     void tooManyUses() { Captured = true; }
 
-    bool shouldExplore(Use *U) { return true; }
-
     bool captured(Use *U) {
       if (isa<ReturnInst>(U->getUser()) && !ReturnCaptures)
         return false;
index f974bd0c045ce8939e8e0da56cfc9de7ff084281..0e16589ececd4dd1cfe9ff6df3343365dc8a30f9 100644 (file)
@@ -276,8 +276,6 @@ namespace {
 
     void tooManyUses() { Captured = true; }
 
-    bool shouldExplore(Use *U) { return true; }
-
     bool captured(Use *U) {
       CallSite CS(U->getUser());
       if (!CS.getInstruction()) { Captured = true; return true; }