1#ifndef ROSE_BinaryAnalysis_CallingConvention_Declaration_H
2#define ROSE_BinaryAnalysis_CallingConvention_Declaration_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_BINARY_ANALYSIS
5#include <Rose/BinaryAnalysis/CallingConvention/BasicTypes.h>
7#include <Rose/BinaryAnalysis/ConcreteLocation.h>
9#include <Sawyer/Result.h>
10#include <Sawyer/SharedObject.h>
18namespace BinaryAnalysis {
19namespace CallingConvention {
38 std::string sourceCode_;
41 std::vector<std::pair<SgAsmType*, std::string>> arguments_;
42 std::vector<std::vector<ConcreteLocation>> argumentLocations_;
43 std::vector<ConcreteLocation> returnLocations_;
83 const std::string&
name()
const;
84 void name(
const std::string&);
130 const std::vector<std::pair<SgAsmType*, std::string>>&
arguments()
const;
161 void computeArgumentLocations();
162 void computeReturnLocations();
Sawyer::Result< std::vector< ConcreteLocation >, std::string > argumentLocation(size_t index) const
Return the concrete location(s) for a function argument, or an error string.
const std::vector< std::pair< SgAsmType *, std::string > > & arguments() const
Property: The type and name for each argument.
Sawyer::Result< std::vector< ConcreteLocation >, std::string > returnLocation() const
Return concrete location for the function return value, if any, or an error string.
SgAsmType * returnType() const
Property: Return type.
size_t nArguments() const
Property: Number of arguments.
const std::string & name() const
Property: Name.
static Ptr instance(const DefinitionPtr &, const std::string &)
Create a function declaration by parsing a C-like declaration.
const std::string & comment() const
Property: Comment.
void comment(const std::string &)
Property: Comment.
const std::string & argumentName(size_t index) const
Property: Optional argument name.
void name(const std::string &)
Property: Name.
SgAsmType * argumentType(size_t index) const
Property: Argument type.
DefinitionPtr callingConvention() const
Property: Calling convention.
Sawyer::Result< std::vector< ConcreteLocation >, std::string > argumentLocation(const std::string &argName) const
Return the concrete location(s) for a function argument, or an error string.
const std::string & toString() const
Source code from which declaration was parsed.
Result containing a value or an error.
Base class for reference counted objects.
Reference-counting intrusive smart pointer.
Base class for binary types.
Sawyer::SharedPointer< Declaration > DeclarationPtr
Shared-ownership pointer to Declaration.