Index: llvm/include/llvm/Transforms/IPO/Attributor.h =================================================================== --- llvm/include/llvm/Transforms/IPO/Attributor.h +++ llvm/include/llvm/Transforms/IPO/Attributor.h @@ -2025,6 +2025,9 @@ /// This function should return the name of the AbstractAttribute virtual const std::string getName() const = 0; + + /// This function should return the address of the ID of the AbstractAttribute + virtual const char *getIdAddr() const = 0; ///} /// Allow the Attributor access to the protected methods. @@ -2142,6 +2145,9 @@ /// See AbstractAttribute::getName() const std::string getName() const override { return "AAReturnedValues"; } + /// See AbstractAttribute::getIdAddr() + const char *getIdAddr() const override { return &ID; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2163,6 +2169,9 @@ /// See AbstractAttribute::getName() const std::string getName() const override { return "AANoUnwind"; } + /// See AbstractAttribute::getIdAddr() + const char *getIdAddr() const override { return &ID; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2184,6 +2193,9 @@ /// See AbstractAttribute::getName() const std::string getName() const override { return "AANoSync"; } + /// See AbstractAttribute::getIdAddr() + const char *getIdAddr() const override { return &ID; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2206,6 +2218,9 @@ /// See AbstractAttribute::getName() const std::string getName() const override { return "AANonNull"; } + /// See AbstractAttribute::getIdAddr() + const char *getIdAddr() const override { return &ID; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2228,6 +2243,9 @@ /// See AbstractAttribute::getName() const std::string getName() const override { return "AANoRecurse"; } + /// See AbstractAttribute::getIdAddr() + const char *getIdAddr() const override { return &ID; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2250,6 +2268,9 @@ /// See AbstractAttribute::getName() const std::string getName() const override { return "AAWillReturn"; } + /// See AbstractAttribute::getIdAddr() + const char *getIdAddr() const override { return &ID; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2279,6 +2300,9 @@ /// See AbstractAttribute::getName() const std::string getName() const override { return "AAUndefinedBehavior"; } + /// See AbstractAttribute::getIdAddr() + const char *getIdAddr() const override { return &ID; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2310,6 +2334,9 @@ /// See AbstractAttribute::getName() const std::string getName() const override { return "AAReachability"; } + /// See AbstractAttribute::getIdAddr() + const char *getIdAddr() const override { return &ID; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2332,6 +2359,9 @@ /// See AbstractAttribute::getName() const std::string getName() const override { return "AANoAlias"; } + /// See AbstractAttribute::getIdAddr() + const char *getIdAddr() const override { return &ID; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2354,6 +2384,9 @@ /// See AbstractAttribute::getName() const std::string getName() const override { return "AANoFree"; } + /// See AbstractAttribute::getIdAddr() + const char *getIdAddr() const override { return &ID; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2376,6 +2409,9 @@ /// See AbstractAttribute::getName() const std::string getName() const override { return "AANoReturn"; } + /// See AbstractAttribute::getIdAddr() + const char *getIdAddr() const override { return &ID; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2433,6 +2469,9 @@ /// See AbstractAttribute::getName() const std::string getName() const override { return "AAIsDead"; } + /// See AbstractAttribute::getIdAddr() + const char *getIdAddr() const override { return &ID; } + /// Unique ID (due to the unique address) static const char ID; @@ -2626,6 +2665,9 @@ /// See AbstractAttribute::getName() const std::string getName() const override { return "AADereferenceable"; } + /// See AbstractAttribute::getIdAddr() + const char *getIdAddr() const override { return &ID; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2647,6 +2689,9 @@ /// See AbstractAttribute::getName() const std::string getName() const override { return "AAAlign"; } + /// See AbstractAttribute::getIdAddr() + const char *getIdAddr() const override { return &ID; } + /// Create an abstract attribute view for the position \p IRP. static AAAlign &createForPosition(const IRPosition &IRP, Attributor &A); @@ -2704,6 +2749,9 @@ /// See AbstractAttribute::getName() const std::string getName() const override { return "AANoCapture"; } + /// See AbstractAttribute::getIdAddr() + const char *getIdAddr() const override { return &ID; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2725,6 +2773,9 @@ /// See AbstractAttribute::getName() const std::string getName() const override { return "AAValueSimplify"; } + /// See AbstractAttribute::getIdAddr() + const char *getIdAddr() const override { return &ID; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2745,6 +2796,9 @@ /// See AbstractAttribute::getName() const std::string getName() const override { return "AAHeapToStack"; } + /// See AbstractAttribute::getIdAddr() + const char *getIdAddr() const override { return &ID; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2781,6 +2835,9 @@ /// See AbstractAttribute::getName() const std::string getName() const override { return "AAPrivatizablePtr"; } + /// See AbstractAttribute::getIdAddr() + const char *getIdAddr() const override { return &ID; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2835,6 +2892,9 @@ /// See AbstractAttribute::getName() const std::string getName() const override { return "AAMemoryBehavior"; } + /// See AbstractAttribute::getIdAddr() + const char *getIdAddr() const override { return &ID; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -2996,6 +3056,9 @@ /// See AbstractAttribute::getName() const std::string getName() const override { return "AAMemoryLocation"; } + /// See AbstractAttribute::getIdAddr() + const char *getIdAddr() const override { return &ID; } + /// Unique ID (due to the unique address) static const char ID; }; @@ -3044,6 +3107,9 @@ /// See AbstractAttribute::getName() const std::string getName() const override { return "AAValueConstantRange"; } + /// See AbstractAttribute::getIdAddr() + const char *getIdAddr() const override { return &ID; } + /// Unique ID (due to the unique address) static const char ID; }; Index: llvm/lib/Transforms/IPO/OpenMPOpt.cpp =================================================================== --- llvm/lib/Transforms/IPO/OpenMPOpt.cpp +++ llvm/lib/Transforms/IPO/OpenMPOpt.cpp @@ -816,6 +816,9 @@ /// See AbstractAttribute::getName() const std::string getName() const override { return "AAICVTracker"; } + /// See AbstractAttribute::getIdAddr() + const char *getIdAddr() const override { return &ID; } + static const char ID; };