diff --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h index e4fc70253c5559..93fc89278c790a 100644 --- a/llvm/include/llvm/Transforms/IPO/Attributor.h +++ b/llvm/include/llvm/Transforms/IPO/Attributor.h @@ -2014,6 +2014,9 @@ struct AbstractAttribute : public IRPosition { /// This function should return the "summarized" assumed state as string. virtual const std::string getAsStr() const = 0; + + /// This function should return the name of the AbstractAttribute + virtual const std::string getName() const = 0; ///} /// Allow the Attributor access to the protected methods. @@ -2128,6 +2131,9 @@ struct AAReturnedValues static AAReturnedValues &createForPosition(const IRPosition &IRP, Attributor &A); + /// See AbstractAttribute::getName() + const std::string getName() const override { return "AAReturnedValues"; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2146,6 +2152,9 @@ struct AANoUnwind /// Create an abstract attribute view for the position \p IRP. static AANoUnwind &createForPosition(const IRPosition &IRP, Attributor &A); + /// See AbstractAttribute::getName() + const std::string getName() const override { return "AANoUnwind"; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2164,6 +2173,9 @@ struct AANoSync /// Create an abstract attribute view for the position \p IRP. static AANoSync &createForPosition(const IRPosition &IRP, Attributor &A); + /// See AbstractAttribute::getName() + const std::string getName() const override { return "AANoSync"; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2183,6 +2195,9 @@ struct AANonNull /// Create an abstract attribute view for the position \p IRP. static AANonNull &createForPosition(const IRPosition &IRP, Attributor &A); + /// See AbstractAttribute::getName() + const std::string getName() const override { return "AANonNull"; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2202,6 +2217,9 @@ struct AANoRecurse /// Create an abstract attribute view for the position \p IRP. static AANoRecurse &createForPosition(const IRPosition &IRP, Attributor &A); + /// See AbstractAttribute::getName() + const std::string getName() const override { return "AANoRecurse"; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2221,6 +2239,9 @@ struct AAWillReturn /// Create an abstract attribute view for the position \p IRP. static AAWillReturn &createForPosition(const IRPosition &IRP, Attributor &A); + /// See AbstractAttribute::getName() + const std::string getName() const override { return "AAWillReturn"; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2247,6 +2268,9 @@ struct AAUndefinedBehavior static AAUndefinedBehavior &createForPosition(const IRPosition &IRP, Attributor &A); + /// See AbstractAttribute::getName() + const std::string getName() const override { return "AAUndefinedBehavior"; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2275,6 +2299,9 @@ struct AAReachability : public StateWrapper { static AAReachability &createForPosition(const IRPosition &IRP, Attributor &A); + /// See AbstractAttribute::getName() + const std::string getName() const override { return "AAReachability"; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2294,6 +2321,9 @@ struct AANoAlias /// Create an abstract attribute view for the position \p IRP. static AANoAlias &createForPosition(const IRPosition &IRP, Attributor &A); + /// See AbstractAttribute::getName() + const std::string getName() const override { return "AANoAlias"; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2313,6 +2343,9 @@ struct AANoFree /// Create an abstract attribute view for the position \p IRP. static AANoFree &createForPosition(const IRPosition &IRP, Attributor &A); + /// See AbstractAttribute::getName() + const std::string getName() const override { return "AANoFree"; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2332,6 +2365,9 @@ struct AANoReturn /// Create an abstract attribute view for the position \p IRP. static AANoReturn &createForPosition(const IRPosition &IRP, Attributor &A); + /// See AbstractAttribute::getName() + const std::string getName() const override { return "AANoReturn"; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2386,6 +2422,9 @@ struct AAIsDead : public StateWrapper { return F.hasPersonalityFn() && !canSimplifyInvokeNoUnwind(&F); } + /// See AbstractAttribute::getName() + const std::string getName() const override { return "AAIsDead"; } + /// Unique ID (due to the unique address) static const char ID; @@ -2576,6 +2615,9 @@ struct AADereferenceable static AADereferenceable &createForPosition(const IRPosition &IRP, Attributor &A); + /// See AbstractAttribute::getName() + const std::string getName() const override { return "AADereferenceable"; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2594,6 +2636,9 @@ struct AAAlign : public IRAttribute< /// Return known alignment. unsigned getKnownAlign() const { return getKnown(); } + /// See AbstractAttribute::getName() + const std::string getName() const override { return "AAAlign"; } + /// Create an abstract attribute view for the position \p IRP. static AAAlign &createForPosition(const IRPosition &IRP, Attributor &A); @@ -2648,6 +2693,9 @@ struct AANoCapture /// Create an abstract attribute view for the position \p IRP. static AANoCapture &createForPosition(const IRPosition &IRP, Attributor &A); + /// See AbstractAttribute::getName() + const std::string getName() const override { return "AANoCapture"; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2666,6 +2714,9 @@ struct AAValueSimplify : public StateWrapper { static AAValueSimplify &createForPosition(const IRPosition &IRP, Attributor &A); + /// See AbstractAttribute::getName() + const std::string getName() const override { return "AAValueSimplify"; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2683,6 +2734,9 @@ struct AAHeapToStack : public StateWrapper { /// Create an abstract attribute view for the position \p IRP. static AAHeapToStack &createForPosition(const IRPosition &IRP, Attributor &A); + /// See AbstractAttribute::getName() + const std::string getName() const override { return "AAHeapToStack"; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2716,6 +2770,9 @@ struct AAPrivatizablePtr static AAPrivatizablePtr &createForPosition(const IRPosition &IRP, Attributor &A); + /// See AbstractAttribute::getName() + const std::string getName() const override { return "AAPrivatizablePtr"; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2767,6 +2824,9 @@ struct AAMemoryBehavior static AAMemoryBehavior &createForPosition(const IRPosition &IRP, Attributor &A); + /// See AbstractAttribute::getName() + const std::string getName() const override { return "AAMemoryBehavior"; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2925,6 +2985,9 @@ struct AAMemoryLocation return getMemoryLocationsAsStr(getAssumedNotAccessedLocation()); } + /// See AbstractAttribute::getName() + const std::string getName() const override { return "AAMemoryLocation"; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2970,6 +3033,9 @@ struct AAValueConstantRange return nullptr; } + /// See AbstractAttribute::getName() + const std::string getName() const override { return "AAValueConstantRange"; } + /// Unique ID (due to the unique address) static const char ID; };