summaryrefslogtreecommitdiffstats
path: root/llvm/include/llvm/Transforms/IPO/Attributor.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/include/llvm/Transforms/IPO/Attributor.h')
-rw-r--r--llvm/include/llvm/Transforms/IPO/Attributor.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h
index bea369a6b51..54c996e0da5 100644
--- a/llvm/include/llvm/Transforms/IPO/Attributor.h
+++ b/llvm/include/llvm/Transforms/IPO/Attributor.h
@@ -675,6 +675,15 @@ struct Attributor {
void identifyDefaultAbstractAttributes(
Function &F, DenseSet<const char *> *Whitelist = nullptr);
+ /// Record that \p I is deleted after information was manifested.
+ void deleteAfterManifest(Instruction &I) { ToBeDeletedInsts.insert(&I); }
+
+ /// Record that \p BB is deleted after information was manifested.
+ void deleteAfterManifest(BasicBlock &BB) { ToBeDeletedBlocks.insert(&BB); }
+
+ /// Record that \p F is deleted after information was manifested.
+ void deleteAfterManifest(Function &F) { ToBeDeletedFunctions.insert(&F); }
+
/// Return true if \p AA (or its context instruction) is assumed dead.
///
/// If \p LivenessAA is not provided it is queried.
@@ -765,6 +774,14 @@ private:
/// The information cache that holds pre-processed (LLVM-IR) information.
InformationCache &InfoCache;
+
+ /// Functions, blocks, and instructions we delete after manifest is done.
+ ///
+ ///{
+ SmallPtrSet<Function *, 8> ToBeDeletedFunctions;
+ SmallPtrSet<BasicBlock *, 8> ToBeDeletedBlocks;
+ SmallPtrSet<Instruction *, 8> ToBeDeletedInsts;
+ ///}
};
/// An interface to query the internal state of an abstract attribute.
OpenPOWER on IntegriCloud