Index: llvm/include/llvm/Transforms/IPO/Attributor.h =================================================================== --- llvm/include/llvm/Transforms/IPO/Attributor.h +++ llvm/include/llvm/Transforms/IPO/Attributor.h @@ -2014,6 +2014,9 @@ /// 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 @@ 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 @@ /// 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 @@ /// 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 @@ /// 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 @@ /// 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 @@ /// 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 @@ 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 @@ 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 @@ /// 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 @@ /// 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 @@ /// 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 @@ 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 @@ 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 @@ /// 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 @@ /// 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 @@ 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 @@ /// 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 @@ 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 @@ 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 @@ 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 @@ return nullptr; } + /// See AbstractAttribute::getName() + const std::string getName() const override { return "AAValueConstantRange"; } + /// Unique ID (due to the unique address) static const char ID; };