1 \subsection{Class FunctionBase}\label{FunctionBase}
2 The \code{FunctionBase} class provides a common interface that can represent either a regular function or an inlined function.
4 \begin{tabular}{p{1.25in}p{1.125in}p{3.125in}}
6 Method name & Return type & Method description \\
8 getModule & const Module * & Module this function belongs to. \\
9 getSize & unsigned & Size encoded in the symbol table; may not be actual function size. \\
10 getRegion & Region * & Region containing this function. \\
11 getReturnType & Type * & Type representing the return type of the function. \\
12 getName & std::string & Returns primary name of the function (first mangled name or DWARF name) \\
17 bool setModule (Module *module)
20 This function changes the module to which the function belongs to \code{module}. Returns \code{true} if it succeeds.
24 bool setSize (unsigned size)
27 This function changes the size of the function to \code{size}. Returns \code{true} if it succeeds.
31 bool setOffset (Offset offset)
34 The method changes the offset of the function to \code{offset}. Returns \code{true} if it succeeds.
38 bool addMangledName(string name,
42 This method adds a mangled name \code{name} to the function. If \code{isPrimary} is \code{true} then it becomes the default name for the function.
43 This method returns \code{true} on success and \code{false} on failure.
47 bool addPrettyName(string name,
51 This method adds a pretty name \code{name} to the function. If \code{isPrimary} is \code{true} then it becomes the default name for the function.
52 This method returns \code{true} on success and \code{false} on failure.
56 bool addTypedName(string name,
60 This method adds a typed name \code{name} to the function. If \code{isPrimary} is \code{true} then it becomes the default name for the function.
61 This method returns \code{true} on success and \code{false} on failure.
65 bool getLocalVariables(vector<localVar *> &vars)
68 This method returns the local variables in the function. \code{vars} contains the list of variables found.
69 If there is no debugging information present then it returns \code{false} with the
70 error code set to \code{NO\_DEBUG\_INFO} accordingly. Otherwise it returns \code{true}.
74 std::vector<VariableLocation> &getFramePtr()
77 This method returns a list of frame pointer offsets (abstract top of the stack) for the function. See the \code{VariableLocation} class description for more information.
81 bool getParams(vector<localVar *> ¶ms)
84 This method returns the parameters to the function. \code{params} contains the list of parameters.
85 If there is no debugging information present then it returns \code{false} with the
86 error code set to \code{NO\_DEBUG\_INFO} accordingly. Returns \code{true} on success.
90 bool findLocalVariable(vector<localVar *> &vars,
94 This method returns a list of local variables within a function that have name \code{name}. \code{vars} contains the list of variables found.
95 Returns \code{true} on success and \code{false} on failure.
101 bool setReturnType(Type *type)
104 Sets the return type of a function to \code{type}.
108 FunctionBase* getInlinedParent()
111 Gets the function that this function is inlined into, if any. Returns \code{NULL} if there is no parent.
115 const InlineCollection& getInlines()
118 Gets the set of functions inlined into this one (possibly empty).