OpenASIP  2.0
PRegionMarkerAnalyzer.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2012 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file PRegionMarkerAnalyzer.hh
26  *
27  * Helper class for analyzing the PREGION_START/PREGION_END markers.
28  *
29  * @author Pekka Jääskeläinen 2012
30  */
31 
32 #ifndef TCE_PREGION_MARKER_ANALYZER_HH
33 #define TCE_PREGION_MARKER_ANALYZER_HH
34 
35 #include <map>
36 
37 namespace llvm {
38  class MachineFunction;
39  class MachineInstr;
40 }
41 
43 public:
44  PRegionMarkerAnalyzer(const llvm::MachineFunction& MF_);
46 
47  bool markersFound() const;
48  unsigned pregion(const llvm::MachineInstr &I) const;
49 
50 private:
51  bool isPregionEndMarker(const llvm::MachineInstr &I) const;
52  bool isPregionStartMarker(const llvm::MachineInstr &I) const;
53  unsigned parsePregionID(const llvm::MachineInstr &I) const;
54 
55  void findPregions();
56  void propagatePregionID(
57  const llvm::MachineInstr& start, unsigned id);
58 
59  // The machine function we are analyzing with this instance.
60  const llvm::MachineFunction& MF;
62  std::map<const llvm::MachineInstr*, unsigned> pregionIDs_;
63 };
64 
65 #endif
PRegionMarkerAnalyzer
Definition: PRegionMarkerAnalyzer.hh:42
llvm
Definition: InlineAsmParser.hh:49
PRegionMarkerAnalyzer::parsePregionID
unsigned parsePregionID(const llvm::MachineInstr &I) const
Definition: PRegionMarkerAnalyzer.cc:152
PRegionMarkerAnalyzer::findPregions
void findPregions()
Definition: PRegionMarkerAnalyzer.cc:107
PRegionMarkerAnalyzer::propagatePregionID
void propagatePregionID(const llvm::MachineInstr &start, unsigned id)
Definition: PRegionMarkerAnalyzer.cc:68
PRegionMarkerAnalyzer::isPregionEndMarker
bool isPregionEndMarker(const llvm::MachineInstr &I) const
Definition: PRegionMarkerAnalyzer.cc:128
PRegionMarkerAnalyzer::MF
const llvm::MachineFunction & MF
Definition: PRegionMarkerAnalyzer.hh:60
PRegionMarkerAnalyzer::isPregionStartMarker
bool isPregionStartMarker(const llvm::MachineInstr &I) const
Definition: PRegionMarkerAnalyzer.cc:140
PRegionMarkerAnalyzer::PRegionMarkerAnalyzer
PRegionMarkerAnalyzer(const llvm::MachineFunction &MF_)
Definition: PRegionMarkerAnalyzer.cc:48
PRegionMarkerAnalyzer::markersFound
bool markersFound() const
Definition: PRegionMarkerAnalyzer.cc:123
PRegionMarkerAnalyzer::pregionIDs_
std::map< const llvm::MachineInstr *, unsigned > pregionIDs_
Definition: PRegionMarkerAnalyzer.hh:62
PRegionMarkerAnalyzer::markersFound_
bool markersFound_
Definition: PRegionMarkerAnalyzer.hh:61
PRegionMarkerAnalyzer::~PRegionMarkerAnalyzer
virtual ~PRegionMarkerAnalyzer()
Definition: PRegionMarkerAnalyzer.hh:45
PRegionMarkerAnalyzer::pregion
unsigned pregion(const llvm::MachineInstr &I) const
Definition: PRegionMarkerAnalyzer.cc:166