"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "projects/CodeThorn/src/FunctionCallMapping2.h" between
rose-0.11.53.0.tar.gz and rose-0.11.54.0.tar.gz

About: ROSE is a compiler infrastructure to build source-to-source program transformation and analysis tools for large-scale C, C++, UPC, Fortran, OpenMP, Java, Python and PHP applications.

FunctionCallMapping2.h  (rose-0.11.53.0):FunctionCallMapping2.h  (rose-0.11.54.0)
#ifndef FUNCTION_CALL_MAPPING2_H #ifndef FUNCTION_CALL_MAPPING2_H
#define FUNCTION_CALL_MAPPING2_H #define FUNCTION_CALL_MAPPING2_H
#include <string> #include <string>
#include <unordered_set> #include <unordered_set>
#include <unordered_map> #include <unordered_map>
#include "Labeler.h" #include "Labeler.h"
#include "FunctionCallTarget.h" #include "FunctionCallTarget.h"
#include "ClassHierarchyGraph.h" #include "ClassHierarchyAnalysis.h"
// struct ClassHierarchyWrapper;
namespace CodeThorn { namespace CodeThorn {
// \todo when ROSE allows C++11, move this to Labeler.h as std::hash<CodeThorn ::Label> ... // \todo when ROSE allows C++11, move this to Labeler.h as std::hash<CodeThorn ::Label> ...
// C++11 and newer allow template specializations for user defined // C++11 and newer allow template specializations for user defined
// types to be made within namespace std. // types to be made within namespace std.
struct HashLabel struct HashLabel
{ {
std::size_t operator()(Label lbl) const noexcept std::size_t operator()(Label lbl) const noexcept
{ {
skipping to change at line 38 skipping to change at line 36
/// tests if n occurs as part of a template /// tests if n occurs as part of a template
// \todo consider only labeling non-template code.. // \todo consider only labeling non-template code..
bool insideTemplatedCode(const SgNode* n); bool insideTemplatedCode(const SgNode* n);
/*! /*!
* \author Markus Schordan * \author Markus Schordan
* \date 2019. * \date 2019.
*/ */
class FunctionCallMapping2 { class FunctionCallMapping2 {
public: public:
FunctionCallMapping2(Labeler* labeler, ClassAnalysis* classAnalysis, Virtual
FunctionAnalysis* virtualFunctions)
: mapping(), _labeler(labeler), _classAnalysis(classAnalysis), _virtualFunct
ions(virtualFunctions)
{
ASSERT_not_null(_labeler);
ASSERT_not_null(_classAnalysis);
ASSERT_not_null(_virtualFunctions);
}
~FunctionCallMapping2() = default;
void computeFunctionCallMapping(SgProject*); void computeFunctionCallMapping(SgProject*);
FunctionCallTargetSet resolveFunctionCall(Label callLabel); FunctionCallTargetSet resolveFunctionCall(Label callLabel);
std::string toString(); std::string toString();
/** access the class hierarchy for analyzing member function calls. /** access the class hierarchy for analyzing member function calls.
* @{ * @{
*/ */
void setClassHierarchy(ClassHierarchyWrapper* ch) { classHierarchy = ch; } ClassAnalysis* getClassAnalysis() const { return _classAnalysis; }
ClassHierarchyWrapper* getClassHierarchy() const { return classHierarchy; } /** @} */
/** access the class hierarchy for analyzing member function calls.
* @{
*/
VirtualFunctionAnalysis* getVirtualFunctions() const { return _virtualFuncti
ons; }
/** @} */ /** @} */
/** access the labeler. /** access the labeler.
* @{ * @{
*/ */
void setLabeler(Labeler* lbler) { labeler = lbler; } Labeler* getLabeler() const { return _labeler; }
Labeler* getLabeler() const { return labeler; }
/** @} */ /** @} */
static void initDiagnostics(); // static void initDiagnostics(); \use CodeThorn diagnostics
protected: protected:
std::unordered_map<Label, FunctionCallTargetSet, HashLabel> mapping; std::unordered_map<Label, FunctionCallTargetSet, HashLabel> mapping;
Labeler* labeler; Labeler* _labeler;
ClassAnalysis* _classAnalysis;
VirtualFunctionAnalysis* _virtualFunctions;
private: private:
unsigned int _matchMode=3; // workaround mode unsigned int _matchMode=3; // workaround mode
ClassHierarchyWrapper* classHierarchy = nullptr;
FunctionCallMapping2() = delete;
FunctionCallMapping2(const FunctionCallMapping2&) = delete;
FunctionCallMapping2(FunctionCallMapping2&&) = delete;
FunctionCallMapping2& operator=(const FunctionCallMapping2&) = delete;
FunctionCallMapping2& operator=(FunctionCallMapping2&&) = delete;
}; };
} // end of namespace CodeThorn } // end of namespace CodeThorn
#endif /* FUNCTION_CALL_MAPPING2_H */ #endif /* FUNCTION_CALL_MAPPING2_H */
 End of changes. 7 change blocks. 
10 lines changed or deleted 32 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)