- /// Obtains a constant pointer to the ParamAttrsList object which holds the
- /// parameter attributes information, if any.
- /// @returns 0 if no parameter attributes have been set.
- /// @brief Get the parameter attributes.
- const ParamAttrsList *getParamAttrs() const { return ParamAttrs; }
+ /// getAttributes - Return the attribute list for this Function.
+ ///
+ const AttrListPtr &getAttributes() const { return AttributeList; }
+
+ /// setAttributes - Set the attribute list for this Function.
+ ///
+ void setAttributes(const AttrListPtr &attrs) { AttributeList = attrs; }
+
+ /// getFnAttributes - Return the function attributes for querying.
+ ///
+ Attributes getFnAttributes() const {
+ return AttributeList.getFnAttributes();
+ }
+
+ /// addFnAttr - Add function attributes to this function.
+ ///
+ void addFnAttr(Attributes::AttrVal N) {
+ // Function Attributes are stored at ~0 index
+ addAttribute(AttrListPtr::FunctionIndex, Attributes::get(getContext(), N));
+ }
+
+ /// removeFnAttr - Remove function attributes from this function.
+ ///
+ void removeFnAttr(Attributes N) {
+ // Function Attributes are stored at ~0 index
+ removeAttribute(~0U, N);
+ }
+
+ /// hasGC/getGC/setGC/clearGC - The name of the garbage collection algorithm
+ /// to use during code generation.
+ bool hasGC() const;
+ const char *getGC() const;
+ void setGC(const char *Str);
+ void clearGC();
+
+
+ /// getRetAttributes - Return the return attributes for querying.
+ Attributes getRetAttributes() const {
+ return AttributeList.getRetAttributes();
+ }