14
14
15
15
#include " CodeRegion.h"
16
16
17
- using namespace llvm ;
18
-
19
17
namespace mca {
20
18
21
- bool CodeRegion::isLocInRange (SMLoc Loc) const {
19
+ bool CodeRegion::isLocInRange (llvm:: SMLoc Loc) const {
22
20
if (RangeEnd.isValid () && Loc.getPointer () > RangeEnd.getPointer ())
23
21
return false ;
24
22
if (RangeStart.isValid () && Loc.getPointer () < RangeStart.getPointer ())
25
23
return false ;
26
24
return true ;
27
25
}
28
26
29
- void CodeRegions::beginRegion (StringRef Description, SMLoc Loc) {
27
+ void CodeRegions::beginRegion (llvm:: StringRef Description, llvm:: SMLoc Loc) {
30
28
assert (!Regions.empty () && " Missing Default region" );
31
29
const CodeRegion &CurrentRegion = *Regions.back ();
32
30
if (CurrentRegion.startLoc ().isValid () && !CurrentRegion.endLoc ().isValid ()) {
33
- SM.PrintMessage (Loc, SourceMgr::DK_Warning,
31
+ SM.PrintMessage (Loc, llvm:: SourceMgr::DK_Warning,
34
32
" Ignoring invalid region start" );
35
33
return ;
36
34
}
@@ -41,19 +39,20 @@ void CodeRegions::beginRegion(StringRef Description, SMLoc Loc) {
41
39
addRegion (Description, Loc);
42
40
}
43
41
44
- void CodeRegions::endRegion (SMLoc Loc) {
42
+ void CodeRegions::endRegion (llvm:: SMLoc Loc) {
45
43
assert (!Regions.empty () && " Missing Default region" );
46
44
CodeRegion &CurrentRegion = *Regions.back ();
47
45
if (CurrentRegion.endLoc ().isValid ()) {
48
- SM.PrintMessage (Loc, SourceMgr::DK_Warning, " Ignoring invalid region end" );
46
+ SM.PrintMessage (Loc, llvm::SourceMgr::DK_Warning,
47
+ " Ignoring invalid region end" );
49
48
return ;
50
49
}
51
50
52
51
CurrentRegion.setEndLocation (Loc);
53
52
}
54
53
55
- void CodeRegions::addInstruction (const MCInst &Instruction) {
56
- const SMLoc &Loc = Instruction.getLoc ();
54
+ void CodeRegions::addInstruction (const llvm:: MCInst &Instruction) {
55
+ const llvm:: SMLoc &Loc = Instruction.getLoc ();
57
56
const auto It =
58
57
std::find_if (Regions.rbegin (), Regions.rend (),
59
58
[Loc](const std::unique_ptr<CodeRegion> &Region) {
0 commit comments