mirror of
https://review.haiku-os.org/haiku
synced 2025-02-07 06:16:11 +01:00
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31168 a95241bf-73f2-0310-859d-f6bbb57e9c96
81 lines
1.1 KiB
C++
81 lines
1.1 KiB
C++
/*
|
|
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
|
|
#include "Statement.h"
|
|
|
|
|
|
// #pragma mark - Statement
|
|
|
|
|
|
Statement::~Statement()
|
|
{
|
|
}
|
|
|
|
|
|
// #pragma mark - AbstractStatement
|
|
|
|
|
|
AbstractStatement::AbstractStatement(const SourceLocation& start,
|
|
const SourceLocation& end)
|
|
:
|
|
fStart(start),
|
|
fEnd(end)
|
|
{
|
|
}
|
|
|
|
|
|
SourceLocation
|
|
AbstractStatement::StartSourceLocation() const
|
|
{
|
|
return fStart;
|
|
}
|
|
|
|
|
|
SourceLocation
|
|
AbstractStatement::EndSourceLocation() const
|
|
{
|
|
return fEnd;
|
|
}
|
|
|
|
|
|
// #pragma mark - ContiguousStatement
|
|
|
|
|
|
ContiguousStatement::ContiguousStatement(const SourceLocation& start,
|
|
const SourceLocation& end, const TargetAddressRange& range)
|
|
:
|
|
AbstractStatement(start, end),
|
|
fRange(range)
|
|
{
|
|
}
|
|
|
|
|
|
TargetAddressRange
|
|
ContiguousStatement::CoveringAddressRange() const
|
|
{
|
|
return fRange;
|
|
}
|
|
|
|
|
|
int32
|
|
ContiguousStatement::CountAddressRanges() const
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
|
|
TargetAddressRange
|
|
ContiguousStatement::AddressRangeAt(int32 index) const
|
|
{
|
|
return index == 0 ? fRange : TargetAddressRange();
|
|
}
|
|
|
|
|
|
bool
|
|
ContiguousStatement::ContainsAddress(target_addr_t address) const
|
|
{
|
|
return fRange.Contains(address);
|
|
}
|