1 /* 2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * Distributed under the terms of the MIT License. 4 */ 5 6 #include "Statement.h" 7 8 9 // #pragma mark - Statement 10 11 12 Statement::~Statement() 13 { 14 } 15 16 17 // #pragma mark - AbstractStatement 18 19 20 AbstractStatement::AbstractStatement(const SourceLocation& start) 21 : 22 fStart(start) 23 { 24 } 25 26 27 SourceLocation 28 AbstractStatement::StartSourceLocation() const 29 { 30 return fStart; 31 } 32 33 34 // #pragma mark - ContiguousStatement 35 36 37 ContiguousStatement::ContiguousStatement(const SourceLocation& start, 38 const TargetAddressRange& range) 39 : 40 AbstractStatement(start), 41 fRange(range) 42 { 43 } 44 45 46 TargetAddressRange 47 ContiguousStatement::CoveringAddressRange() const 48 { 49 return fRange; 50 } 51 52 53 int32 54 ContiguousStatement::CountAddressRanges() const 55 { 56 return 1; 57 } 58 59 60 TargetAddressRange 61 ContiguousStatement::AddressRangeAt(int32 index) const 62 { 63 return index == 0 ? fRange : TargetAddressRange(); 64 } 65 66 67 bool 68 ContiguousStatement::ContainsAddress(target_addr_t address) const 69 { 70 return fRange.Contains(address); 71 } 72