Rose2OA
|
Classes | |
struct | eqTypes |
class | IndexExpressionTraversal |
Functions | |
static std::string | stripParameterType (const std::string &name) |
Strip the "const" keyword from a string. More... | |
void | getTypeInfo (SgType *t, std::string *tname, std::string *stripname, int *size) |
Return a type's name and size. More... | |
bool | isNonStaticMethodCall (SgFunctionCallExp *functionCall, bool &isDotExp) |
isNonStaticMethodCall returns true if the invoked procedure is a method (i.e., a constructor, a destructor, or a non-static method). More... | |
SgPointerDerefExp * | isFunctionPointer (SgFunctionCallExp *functionCall) |
SgFunctionDeclaration * | getFunctionDeclaration (SgFunctionCallExp *functionCall) |
Return the SgFunctionDeclaration invoked by a function call. More... | |
void | verifyCallHandleNodeType (SgNode *node) |
void | verifyStmtHandleNodeType (SgNode *node) |
void | verifySymHandleNodeType (SgNode *node) |
void | getFormalTypes (SgNode *node, std::vector< SgType * > &formalTypes) |
Return a list of the types of the formal parameters involved in a function, method, or constructor invocation. More... | |
bool | isDestructor (SgMemberFunctionDeclaration *memberFunctionDeclaration) |
Returns true if the method is a destructor. More... | |
SgMemberFunctionDeclaration * | lookupDestructorInClass (SgClassDefinition *classDefinition) |
Returns a destructor method declaration within a class if it exists. More... | |
SgNode * | getConstructorInitializerLhs (SgConstructorInitializer *ctorInitializer) |
Return the lhs of a constructor initializer. More... | |
void | getActuals (SgNode *node, std::list< SgNode * > &actuals) |
Return the actual arguments from a method, which may include a constructor or destructor, or function invocation. More... | |
SgFunctionDefinition * | getEnclosingFunction (SgNode *node) |
Return the function in which node occurs. More... | |
static bool | isVirtualWithinDefiningClass (SgFunctionDeclaration *functionDeclaration) |
Return boolean indicating whether a function is declared virtual in its defining class. More... | |
bool | isDeclaredVirtualWithinClassAncestry (SgFunctionDeclaration *functionDeclaration, SgClassDefinition *classDefinition) |
Return boolean indicating whether a function is declared virtual in some parent class of SgClassDefinition. More... | |
static bool | isDeclaredVirtualWithinAncestor (SgFunctionDeclaration *functionDeclaration) |
Return boolean indicating whether a function is declared virtual in some parent class, regardless of whether it is declared virtual in its defining class. More... | |
bool | isConstructor (SgMemberFunctionDeclaration *memberFunctionDeclaration) |
Returns true if the method is a constructor. More... | |
bool | isVirtual (SgFunctionDeclaration *functionDeclaration) |
Return boolean indicating whether a function is virtual– i.e., whether it is declared virtual in its defining class or any of that class' base classes. More... | |
bool | isPureVirtual (SgFunctionDeclaration *functionDeclaration) |
Returns true if method is a pure virtual method. More... | |
bool | hasDefinition (SgFunctionDeclaration *functionDeclaration) |
bool | classHasVirtualMethods (SgClassDefinition *classDefinition) |
Return true if a class or any of its base classes has a virtual method. More... | |
bool | consistentFunctionTypes (SgFunctionType *funcType1, SgFunctionType *funcType2) |
Return boolean indicating whether two functions have the same type signature. More... | |
bool | matchingFunctions (SgFunctionDeclaration *decl1, SgFunctionDeclaration *decl2) |
std::string | mangleFunctionName (SgFunctionDeclaration *functionDeclaration) |
Return a function's mangled name. More... | |
SgClassDeclaration * | getClassDeclaration (SgType *type) |
Return the declaration of the class with a given type. More... | |
SgClassDefinition * | getClassDefinition (SgType *type) |
Return the definition of the class with a given type. More... | |
SgFunctionDeclaration * | getDefiningDeclaration (SgFunctionDeclaration *funcDecl) |
SgClassDeclaration * | getDefiningDeclaration (SgClassDeclaration *classDecl) |
bool | isFunc (SgFunctionCallExp *functionCallExp,::std::string funcName) |
Returns boolean indicating whether the invoked function has name funcName. More... | |
bool | returnsReference (SgFunctionCallExp *functionCallExp) |
bool | returnsAddress (SgFunctionCallExp *functionCallExp) |
SgNode * | getThisExpNode (SgNode *node) |
Return a SgNode representing a 'this' expression. More... | |
bool | isObjectInitialization (SgConstructorInitializer *ctorInitializer) |
Return boolean indicating whether the SgConstructorInitializer initializes an object. More... | |
bool | isBaseClassInvocation (SgConstructorInitializer *ctorInitializer) |
SgMemberFunctionDeclaration * | getInvokedMethod (SgMemberFunctionRefExp *memberFunctionRefExp) |
bool | isNonStaticMethod (SgMemberFunctionDeclaration *memberFunctionDecl) |
isNonStaticMethod returns boolen indicating whether the method is a non-static method. More... | |
bool | isVaStart (SgFunctionCallExp *functionCallExp) |
Return boolean indicating whether the invoked function is va_start. More... | |
SgType * | getBaseType (SgType *type) |
SgType * | lookThruReferenceType (SgType *type) |
bool | isArrowExp (SgExpression *function) |
bool | findNodeInSubtree (SgNode *needle, SgNode *haystack) |
bool | isPlacementNew (SgNewExp *newExp) |
SgFunctionDeclaration * | isPlacementDelete (SgDeleteExp *deleteExp) |
bool | isOperatorNew (SgFunctionDeclaration *functionDeclaration) |
std::vector < SgFunctionDeclaration * > | getFunctionsInDerivedClasses (SgClassDefinition *cls, SgFunctionType *funcType, ClassHierarchyWrapper *classHierarchy) |
std::set< SgFunctionDeclaration * > | getFunctionsConsistentWithMethodPointerInvocation (SgBinaryOp *dotStarOrArrowStar, ClassHierarchyWrapper *classHierarchy) |
SgGlobal * | globalScope (SgFile *file) |
bool | isFunc (SgFunctionCallExp *functionCallExp, std::string funcName) |
template<class T > | |
void | add_sets (std::set< T * > &set1, std::set< T * > set2) |
void UseOA::add_sets | ( | std::set< T * > & | set1, |
std::set< T * > | set2 | ||
) |
Definition at line 136 of file common.h.
Referenced by UseOA::IndexExpressionTraversal::evaluateSynthesizedAttribute().
bool UseOA::classHasVirtualMethods | ( | SgClassDefinition * | classDefinition) |
Return true if a class or any of its base classes has a virtual method.
classDefinition | a SgNode representing a class definition. |
Definition at line 1229 of file common.C.
References isVirtual().
Referenced by SageIRInterface::createImplicitPtrAssignPairsForObjectDeclaration(), and SageIRInterface::createImplicitPtrAssignPairsForVirtualMethods().
bool UseOA::consistentFunctionTypes | ( | SgFunctionType * | funcType1, |
SgFunctionType * | funcType2 | ||
) |
Return boolean indicating whether two functions have the same type signature.
Definition at line 1290 of file common.C.
References getBaseType(), and getTypeInfo().
Referenced by getFunctionsInDerivedClasses(), and matchingFunctions().
bool UseOA::findNodeInSubtree | ( | SgNode * | needle, |
SgNode * | haystack | ||
) |
void UseOA::getActuals | ( | SgNode * | node, |
std::list< SgNode * > & | actuals | ||
) |
Return the actual arguments from a method, which may include a constructor or destructor, or function invocation.
node | A Sage node representing a method or function invocation– i.e., a SgFunctionCallExp, a SgConstructorInitializer, or a SgDeleteExp. |
actualArgs | On output, holds the expressions passed as actual arguments to the invocation. |
NB: If this is a non-static method invocation, including a constructor or destructor call, then the first actual is the receiver. Yes, the receiver, i.e., the object that is being allocated, is returned for a constructor.
Notice that the receiver may not be a named variable. e.g., (new D)->foo(); bar(new D); return (new D); In each of these cases we return the expression 'new D' as the actual for the implicit receiver.
Definition at line 778 of file common.C.
References isPlacementDelete(), and isPlacementNew().
Referenced by SageIRInterface::getCallsiteParams().
SgType * UseOA::getBaseType | ( | SgType * | type) |
Definition at line 1803 of file common.C.
Referenced by SageIRInterface::applyReferenceConversionRules2And4(), consistentFunctionTypes(), SageIRInterface::createImplicitPtrAssignPairsForDynamicObjectAllocation(), SageIRInterface::createImplicitPtrAssignPairsForObjectDeclaration(), SageIRInterface::createParamBindPtrAssignPairs(), SageIRInterface::findAllMemRefsAndPtrAssigns(), SageIRInterface::getCallMemRefExpr(), SageIRInterface::getDepMemRefExprIter(), SageIRInterface::getFormalForActual(), isBaseClassInvocation(), mangleFunctionName(), returnsAddress(), and FindCallsitesPass::visit().
SgClassDeclaration * UseOA::getClassDeclaration | ( | SgType * | type) |
Return the declaration of the class with a given type.
type | a SgNode representing a type. |
Definition at line 1400 of file common.C.
References getDefiningDeclaration().
Referenced by SageIRInterface::createImplicitPtrAssignPairsForDynamicObjectAllocation(), SageIRInterface::createImplicitPtrAssignPairsForObjectDeclaration(), getClassDefinition(), and getFunctionsConsistentWithMethodPointerInvocation().
SgClassDefinition * UseOA::getClassDefinition | ( | SgType * | type) |
Return the definition of the class with a given type.
type | a SgNode representing a type. |
Definition at line 1489 of file common.C.
References getClassDeclaration().
Referenced by SageIRInterface::findAllMemRefsAndPtrAssigns(), and FindCallsitesPass::visit().
SgNode * UseOA::getConstructorInitializerLhs | ( | SgConstructorInitializer * | ctorInitializer) |
Return the lhs of a constructor initializer.
DEPRECATED MMS 9/7/06
ctorInitializer | A SgConstructorInitializer representing the invocation of a constructor. |
In the following examples, we return the lhs: Foo f; Foo lhs(f); // copy constructor. Foo lhs; // default constructor. Foo lhs(1); // some other constructor; Foo *lhs = new Foo;
In the following examples, the object constructed is anonymous, so we return that anonymous expression– in these examples, new Foo. return (new Foo); bar(new Foo); (new Foo)->methodCall();
For cases involving the invocation of a baseclass constructor:
class Foo : public Bar { Foo(Foo &f) : Bar(f) { } };
we represent the actual implicit 'this' via a SgExprListExp.
We don't really return an expression. Notice in the first few examples, the only thing we can return is a SgInitializedName.
Definition at line 685 of file common.C.
References isObjectInitialization().
SgFunctionDeclaration * UseOA::getDefiningDeclaration | ( | SgFunctionDeclaration * | funcDecl) |
Definition at line 1500 of file common.C.
Referenced by SageIRInterface::createImplicitPtrAssignPairsForClassDefinition(), SageIRInterface::createImplicitPtrAssignPairsForDynamicObjectAllocation(), SageIRInterface::createImplicitPtrAssignPairsForObjectDeclaration(), SageIRInterface::createImplicitPtrAssignPairsForVirtualMethods(), SageIRInterface::findAllMemRefsAndPtrAssigns(), getClassDeclaration(), getFormalTypes(), getFunctionDeclaration(), getFunctionsConsistentWithMethodPointerInvocation(), getGlobalObjectDeclarationsAndClassDefinitions(), hasDefinition(), isDeclaredVirtualWithinClassAncestry(), and SageIRInterface::toString().
SgClassDeclaration * UseOA::getDefiningDeclaration | ( | SgClassDeclaration * | classDecl) |
SgFunctionDefinition * UseOA::getEnclosingFunction | ( | SgNode * | node) |
Return the function in which node occurs.
Return the method in which node occurs.
Definition at line 956 of file common.C.
Referenced by SageIRInterface::findAllMemRefsAndPtrAssigns(), getThisExpNode(), SageIRInterface::getThisFormalSymHandle(), SageIRInterface::toString(), and SageIRInterface::toStringWithoutScope().
void UseOA::getFormalTypes | ( | SgNode * | node, |
std::vector< SgType * > & | formalTypes | ||
) |
Return a list of the types of the formal parameters involved in a function, method, or constructor invocation.
node | a SgNode representing a function/method (SgFunctionCallExp), a constructor (SgConstructorInitializer) invocation, or a destruction (SgDeleteExp) invocation. i.e., node should have a corresponding call handle. |
NB: This does not return the type of the implicit formal parameter corresponding to the 'this' pointer. Contrast this with getCallsiteParams which folds the actual corresponding to the 'this' pointer in as the first argument.
Definition at line 386 of file common.C.
References getDefiningDeclaration(), getFunctionDeclaration(), isFunctionPointer(), isPlacementDelete(), isPlacementNew(), lookThruReferenceType(), lookupDestructorInClass(), and verifyCallHandleNodeType().
Referenced by SageIRInterface::createParamBindPtrAssignPairs().
SgFunctionDeclaration * UseOA::getFunctionDeclaration | ( | SgFunctionCallExp * | functionCall) |
Return the SgFunctionDeclaration invoked by a function call.
functionCall | A SgFunctionCallExp representing a function call site. |
This function does not perform any analysis, therefore it can not determine which function or method is invoked through a pointer. If functionCall is a pointer dereference expression, this function will abort.
Definition at line 191 of file common.C.
Referenced by getFormalTypes().
std::set< SgFunctionDeclaration * > UseOA::getFunctionsConsistentWithMethodPointerInvocation | ( | SgBinaryOp * | dotStarOrArrowStar, |
ClassHierarchyWrapper * | classHierarchy | ||
) |
Return the list of methods that may be called at a method pointer invocation. If the pointer is invoked on a receiver of type T, the conservative set of methods that may be invoked include any non-static, virtual or non-virtual method m with type signature consistent with the method pointer that is defined in a class C. C is any class derived from any of the ancestors of T.
Definition at line 2067 of file common.C.
References getClassDeclaration(), getDefiningDeclaration(), getFunctionsInDerivedClasses(), and isNonStaticMethod().
Referenced by SageIRInterface::findAllMemRefsAndPtrAssigns().
std::vector<SgFunctionDeclaration *> UseOA::getFunctionsInDerivedClasses | ( | SgClassDefinition * | cls, |
SgFunctionType * | funcType, | ||
ClassHierarchyWrapper * | classHierarchy | ||
) |
Return any function declarations defined in cls or any of its derived classes, which have a function signature consistent with funcType.
Definition at line 2009 of file common.C.
References consistentFunctionTypes().
Referenced by getFunctionsConsistentWithMethodPointerInvocation().
SgMemberFunctionDeclaration * UseOA::getInvokedMethod | ( | SgMemberFunctionRefExp * | memberFunctionRefExp) |
Definition at line 1760 of file common.C.
Referenced by SageIRInterface::findAllMemRefsAndPtrAssigns().
SgNode * UseOA::getThisExpNode | ( | SgNode * | node) |
Return a SgNode representing a 'this' expression.
node | A SgNode from which we would like to derive a SgNode for a 'this' expression. |
node should be either a SgMemberFunctionDeclaration or a SgThisExp.
We use the SgFunctionParameterList from the enclosing method to represent the method-specific 'this' expression. NB: Using a class-wide 'this' expression (e.g., a SgClassSymbol) would lead to loss of precision.
Definition at line 1620 of file common.C.
References getEnclosingFunction().
Referenced by SageIRInterface::getThisExpSymHandle().
void UseOA::getTypeInfo | ( | SgType * | t, |
std::string * | tname, | ||
std::string * | stripname, | ||
int * | size | ||
) |
Return a type's name and size.
t | A Sage type. |
tname | On output, holds the string name of the type. |
stripname | On output, holds the string name of the type, stripped of any "const" prefix. |
size | On output, holds the size? I don't know what this size corresponds to. Certainly not the size of the type (which needn't be a word) or string. |
This was copied from .../ROSE/src/midend/astUtil/astInterface/AstInterface.C
To do: move this to a generally-accessible utilities file or make it accessible from AstInterface (by adding its declaration to AstInterface.h).
Definition at line 48 of file common.C.
References stripParameterType().
Referenced by consistentFunctionTypes(), mangleFunctionName(), and UseOA::eqTypes::operator()().
bool UseOA::hasDefinition | ( | SgFunctionDeclaration * | functionDeclaration) |
Definition at line 1201 of file common.C.
References getDefiningDeclaration().
Referenced by SageIRInterface::createImplicitPtrAssignPairsForClassDefinition(), and SageIRInterface::createImplicitPtrAssignPairsForVirtualMethods().
bool UseOA::isArrowExp | ( | SgExpression * | function) |
Returns true if function is a SgArrowExp or a SgDotExp whose operand is a SgPointerDerefExp or a SgDotExp whose lhs is a reference. In this latter case we will convert the lhs to appear as a pointer. i.e., returns true if function represents a->method() or (*a).method().
Definition at line 1909 of file common.C.
Referenced by SageIRInterface::findAllMemRefsAndPtrAssigns().
bool UseOA::isBaseClassInvocation | ( | SgConstructorInitializer * | ctorInitializer) |
Definition at line 1709 of file common.C.
References getBaseType().
Referenced by SageIRInterface::createConstructorInitializerReceiverMRE(), and isObjectInitialization().
bool UseOA::isConstructor | ( | SgMemberFunctionDeclaration * | memberFunctionDeclaration) |
Returns true if the method is a constructor.
memberFunctionDeclaration | A method declaration. |
Definition at line 1134 of file common.C.
Referenced by SageIRInterface::findAllMemRefsAndPtrAssigns(), and isVirtual().
|
static |
Return boolean indicating whether a function is declared virtual in some parent class, regardless of whether it is declared virtual in its defining class.
functionDeclaration | A function declaration within the AST. |
Definition at line 1113 of file common.C.
References isDeclaredVirtualWithinClassAncestry().
Referenced by isVirtual().
bool UseOA::isDeclaredVirtualWithinClassAncestry | ( | SgFunctionDeclaration * | functionDeclaration, |
SgClassDefinition * | classDefinition | ||
) |
Return boolean indicating whether a function is declared virtual in some parent class of SgClassDefinition.
functionDeclaration | A function declaration within the AST. |
Definition at line 1027 of file common.C.
References getDefiningDeclaration(), and isVirtual().
Referenced by isDeclaredVirtualWithinAncestor().
bool UseOA::isDestructor | ( | SgMemberFunctionDeclaration * | memberFunctionDeclaration) |
Returns true if the method is a destructor.
memberFunctionDeclaration | A method declaration. |
Definition at line 600 of file common.C.
Referenced by SageIRInterface::findAllMemRefsAndPtrAssigns(), and lookupDestructorInClass().
bool UseOA::isFunc | ( | SgFunctionCallExp * | functionCallExp, |
std::string | funcName | ||
) |
bool UseOA::isFunc | ( | SgFunctionCallExp * | functionCallExp, |
::std::string | funcName | ||
) |
Returns boolean indicating whether the invoked function has name funcName.
functionCallExp | A SgFunctionCallExp representing an invoked function. |
funcName | A string representing the name of a function. |
Definition at line 1518 of file common.C.
Referenced by SageIRInterface::findAllMemRefsAndPtrAssigns(), and isVaStart().
SgPointerDerefExp * UseOA::isFunctionPointer | ( | SgFunctionCallExp * | functionCall) |
Returns a SgPointerDerefExp if the function call is made through a pointer and NULL otherwise.
Definition at line 155 of file common.C.
Referenced by getFormalTypes().
bool UseOA::isNonStaticMethod | ( | SgMemberFunctionDeclaration * | memberFunctionDecl) |
isNonStaticMethod returns boolen indicating whether the method is a non-static method.
Definition at line 1783 of file common.C.
Referenced by SageIRInterface::getFormalParamIterator(), and getFunctionsConsistentWithMethodPointerInvocation().
bool UseOA::isNonStaticMethodCall | ( | SgFunctionCallExp * | functionCall, |
bool & | isDotExp | ||
) |
isNonStaticMethodCall returns true if the invoked procedure is a method (i.e., a constructor, a destructor, or a non-static method).
functionCall | A Sage node representing a function call expression. |
isDotExp | On output, a boolean indicating whether the receiver of a method invocation is an object (isDotExp = true) or a pointer (isDotExp = false). |
Be Careful! For the purposes of isNonStaticMethodCall a method is anything which has or creates a receiver/"this." That is a constructor (which creates a this and may modify/initialization it), a destructor, or a non-static method. Each of these is passed an implicit "this" parameter. A static method may only access static member variables, therefore we need not pass an implicit "this" (which is convenient, since we don't have one).
Definition at line 87 of file common.C.
Referenced by SageIRInterface::createParamBindPtrAssignPairs().
bool UseOA::isObjectInitialization | ( | SgConstructorInitializer * | ctorInitializer) |
Return boolean indicating whether the SgConstructorInitializer initializes an object.
ctorInitializer | A SgConstructorInitializer. |
The following are object initializations: Foo f; Foo(Bar &b) : mBar(b) { }
The following are not: Foo *f = new Foo; class Foo : public Bar { Foo(Foo &f) : Bar(f) { } }
Notice that the Bar in Bar(f) in the initializer is represented by a SgInitializedName, whose name is 'Bar'. Thus if the name of the SgInitializedName and of the invoked constructor are the same, this is an invocation of a base class constructor.
Definition at line 1693 of file common.C.
References isBaseClassInvocation().
Referenced by SageIRInterface::createParamBindPtrAssignPairs(), and getConstructorInitializerLhs().
bool UseOA::isOperatorNew | ( | SgFunctionDeclaration * | functionDeclaration) |
Definition at line 1989 of file common.C.
Referenced by SageIRInterface::createImplicitPtrAssignPairsForDynamicObjectAllocation(), SageIRInterface::getFormalParamIterator(), and SageIRInterface::toString().
SgFunctionDeclaration * UseOA::isPlacementDelete | ( | SgDeleteExp * | deleteExp) |
Definition at line 1981 of file common.C.
Referenced by SageIRInterface::createParamBindPtrAssignPairs(), SageIRInterface::findAllMemRefsAndPtrAssigns(), getActuals(), SageIRInterface::getCallHandle(), getFormalTypes(), SageIRInterface::toString(), verifyCallHandleNodeType(), and FindCallsitesPass::visit().
bool UseOA::isPlacementNew | ( | SgNewExp * | newExp) |
Definition at line 1965 of file common.C.
Referenced by SageIRInterface::createParamBindPtrAssignPairs(), getActuals(), SageIRInterface::getCallHandle(), getFormalTypes(), SageIRInterface::toString(), verifyCallHandleNodeType(), and FindCallsitesPass::visit().
bool UseOA::isPureVirtual | ( | SgFunctionDeclaration * | functionDeclaration) |
Returns true if method is a pure virtual method.
functionDeclaration | A method declaration. |
Definition at line 1181 of file common.C.
Referenced by SageIRInterface::createImplicitPtrAssignPairsForClassDefinition(), and SageIRInterface::createImplicitPtrAssignPairsForVirtualMethods().
bool UseOA::isVaStart | ( | SgFunctionCallExp * | functionCallExp) |
Return boolean indicating whether the invoked function is va_start.
Definition at line 1793 of file common.C.
References isFunc().
Referenced by SageIRInterface::findAllMemRefsAndPtrAssigns(), and FindCallsitesPass::visit().
bool UseOA::isVirtual | ( | SgFunctionDeclaration * | functionDeclaration) |
Return boolean indicating whether a function is virtual– i.e., whether it is declared virtual in its defining class or any of that class' base classes.
Definition at line 1151 of file common.C.
References isConstructor(), isDeclaredVirtualWithinAncestor(), and isVirtualWithinDefiningClass().
Referenced by classHasVirtualMethods(), SageIRInterface::createImplicitPtrAssignPairsForClassDefinition(), SageIRInterface::createImplicitPtrAssignPairsForVirtualMethods(), SageIRInterface::findAllMemRefsAndPtrAssigns(), and isDeclaredVirtualWithinClassAncestry().
|
static |
Return boolean indicating whether a function is declared virtual in its defining class.
functionDeclaration | A function declaration within the AST. |
Definition at line 993 of file common.C.
Referenced by isVirtual().
SgType * UseOA::lookThruReferenceType | ( | SgType * | type) |
Definition at line 1824 of file common.C.
Referenced by SageIRInterface::createImplicitPtrAssignPairsForDynamicObjectAllocation(), SageIRInterface::createMemRefExprsForPtrArith(), SageIRInterface::findAllMemRefsAndPtrAssigns(), getFormalTypes(), SageIRInterface::performsPtrArithmetic(), and FindCallsitesPass::visit().
SgMemberFunctionDeclaration * UseOA::lookupDestructorInClass | ( | SgClassDefinition * | classDefinition) |
Returns a destructor method declaration within a class if it exists.
classDefinition | a SgNode representing a class definition. |
Definition at line 619 of file common.C.
References isDestructor().
Referenced by SageIRInterface::findAllMemRefsAndPtrAssigns(), getFormalTypes(), and FindCallsitesPass::visit().
std::string UseOA::mangleFunctionName | ( | SgFunctionDeclaration * | functionDeclaration) |
Return a function's mangled name.
We do not rely on ROSE's funcDecl->get_mangled_name().str() because it will include the class scope information for a member function. This will undermine its use in a virtual method field because we want a single field to be able to point to any of a number of virtual methods defined/declared within a class hierarchy.
For now, just include the function name and the return and formal types, each separated by an underscore. This may not be sufficient to capture, e.g., template info.
Definition at line 1366 of file common.C.
References getBaseType(), and getTypeInfo().
Referenced by SageIRInterface::createImplicitPtrAssignPairsForClassDefinition(), SageIRInterface::createImplicitPtrAssignPairsForVirtualMethods(), and SageIRInterface::toStringWithoutScope().
bool UseOA::matchingFunctions | ( | SgFunctionDeclaration * | decl1, |
SgFunctionDeclaration * | decl2 | ||
) |
Definition at line 1335 of file common.C.
References consistentFunctionTypes().
Referenced by SageIRInterface::createImplicitPtrAssignPairsForClassDefinition(), and SageIRInterface::createImplicitPtrAssignPairsForVirtualMethods().
bool UseOA::returnsAddress | ( | SgFunctionCallExp * | functionCallExp) |
Definition at line 1570 of file common.C.
References getBaseType().
Referenced by SageIRInterface::findAllMemRefsAndPtrAssigns().
bool UseOA::returnsReference | ( | SgFunctionCallExp * | functionCallExp) |
Definition at line 1539 of file common.C.
Referenced by SageIRInterface::findAllMemRefsAndPtrAssigns().
|
static |
Strip the "const" keyword from a string.
name | A string (intending to represent a formal parameter type). |
This was copied from .../ROSE/src/midend/astUtil/astInterface/AstInterface.C
To do: move this to a generally-accessible utilities file or make it accessible from AstInterface (by adding its declaration to AstInterface.h).
Definition at line 18 of file common.C.
Referenced by getTypeInfo().
void UseOA::verifyCallHandleNodeType | ( | SgNode * | node) |
Verify that a node intended to be used as a call handle is one of the expected node types for a call handle.
Definition at line 258 of file common.C.
References isPlacementDelete(), and isPlacementNew().
Referenced by SageIRInterface::createParamBindPtrAssignPairs(), getFormalTypes(), and SageIRInterface::verifyCallHandleType().
void UseOA::verifyStmtHandleNodeType | ( | SgNode * | node) |
Verify that a node intended to be used as a stmt handle is one of the expected node types for a stmt handle.
Definition at line 320 of file common.C.
Referenced by SageIRInterface::verifyStmtHandleType().
void UseOA::verifySymHandleNodeType | ( | SgNode * | node) |
Verify that a node intended to be used as a sym handle is one of the expected node types for a sym handle.
Definition at line 345 of file common.C.
Referenced by SageIRInterface::getSymHandle().