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 12Statement::~Statement() 13{ 14} 15 16 17// #pragma mark - AbstractStatement 18 19 20AbstractStatement::AbstractStatement(const SourceLocation& start) 21 : 22 fStart(start) 23{ 24} 25 26 27SourceLocation 28AbstractStatement::StartSourceLocation() const 29{ 30 return fStart; 31} 32 33 34// #pragma mark - ContiguousStatement 35 36 37ContiguousStatement::ContiguousStatement(const SourceLocation& start, 38 const TargetAddressRange& range) 39 : 40 AbstractStatement(start), 41 fRange(range) 42{ 43} 44 45 46TargetAddressRange 47ContiguousStatement::CoveringAddressRange() const 48{ 49 return fRange; 50} 51 52 53int32 54ContiguousStatement::CountAddressRanges() const 55{ 56 return 1; 57} 58 59 60TargetAddressRange 61ContiguousStatement::AddressRangeAt(int32 index) const 62{ 63 return index == 0 ? fRange : TargetAddressRange(); 64} 65 66 67bool 68ContiguousStatement::ContainsAddress(target_addr_t address) const 69{ 70 return fRange.Contains(address); 71} 72