Skip to content
Snippets Groups Projects
Commit 21c2c99f authored by Jason Hiser's avatar Jason Hiser :tractor:
Browse files

added loop interfaces for deep analysis

parent 51477757
No related branches found
No related tags found
No related merge requests found
......@@ -50,6 +50,9 @@ namespace IRDB_SDK
virtual unique_ptr<StaticGlobalStartMap_t > getStaticGlobalRanges() const = 0;
virtual unique_ptr<RangeSentinelSet_t > getRangeSentinels() const = 0;
virtual unique_ptr<LoopNest_t> getLoopNest(const Function_t* f) const = 0;
virtual unique_ptr<LoopNest_t> getLoopNest(const ControlFlowGraph_t* cfg) const = 0;
// factories
static unique_ptr<DeepAnalysis_t> factory(FileIR_t* firp, const AnalysisEngine_t& ae=aeSTARS, const vector<string>& options={});
};
......
/*
Copyright 2018-2019 Zephyr Software, LLC.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#include <irdb-core>
#include <irdb-cfg>
#include <set>
namespace IRDB_SDK
{
using namespace std;
class Loop_t; // forward decl
using LoopSet_t = set<Loop_t>;
class Loop_t
{
protected:
Loop_t() {}
Loop_t(const Loop_t& copy) = delete;
public:
virtual ~Loop_t();
virtual BasicBlockSet_t getAllBlocks() const = 0;
virtual BasicBlockSet_t getOuterBlocks() const = 0;
virtual LoopSet_t getInnerLoops() const = 0;
virtual bool isBlockInLoop (const BasicBlock_t* blk) const = 0;
virtual bool isBlockInInnerLoop (const BasicBlock_t* blk) const = 0;
virtual bool isBlockOuterLoopOnly(const BasicBlock_t* blk) const = 0;
};
class LoopNest_t
{
protected:
LoopNest_t() {}
LoopNest_t(const LoopNest_t& copy) = delete;
public:
virtual ~LoopNest_t() {}
virtual LoopSet_t getAllLoops() const = 0;
virtual LoopSet_t getOuterLoops() const = 0;
virtual Function_t* getFunction() const = 0;
virtual ControlFlowGraph_t* getCFG() const = 0;
};
}
......@@ -20,6 +20,7 @@
#define IRDB_SDK_deep
#include <inc-deep/loops.hpp>
#include <inc-deep/deep.hpp>
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment