File: NonlocalBranch.C

package info (click to toggle)
guavac 1.0-5
  • links: PTS
  • area: main
  • in suites: hamm, slink
  • size: 2,716 kB
  • ctags: 2,357
  • sloc: cpp: 19,765; yacc: 1,629; makefile: 492; lex: 348; ansic: 284; sh: 280
file content (79 lines) | stat: -rw-r--r-- 1,813 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// Copyright (c) 1996  David Engberg  All rights reserved
// $Id: NonlocalBranch.C,v 1.2 1997/11/10 00:48:06 geppetto Exp $
#pragma implementation
#include "NonlocalBranch.h"
#include <cassert>

//
//  Method name : CNonlocalBranch
//  Description : Default constructor required by list<>.  Don't use directly.
//
CNonlocalBranch::CNonlocalBranch()
  : fContext(0, 0, 0, 0, 0, 0)
{
  assert(0);
}

//
//  Method name : CNonlocalBranch
//  Description : Constructs a non-local branch from the location of its branch
//    address and the context the branch occurs under.
//
CNonlocalBranch::CNonlocalBranch(unsigned long address,
				 const CCompileContext& branchContext)
  : fContext(branchContext),
    fBranchAddress(address)
{
}

//
//  Method name : CNonlocalBranch
//  Description : Copy constructor.
//
CNonlocalBranch::CNonlocalBranch(const CNonlocalBranch& source)
  : fContext(source.fContext),
    fBranchAddress(source.fBranchAddress)
{
}

//
//  Method name : ~CNonlocalBranch
//  Description : Destructor
//
CNonlocalBranch::~CNonlocalBranch()
{
}

//
//  Method name : operator=
//  Description : Assignment operator.
//
CNonlocalBranch&
CNonlocalBranch::operator=(const CNonlocalBranch& source)
{
  if (&source != this) {
    fContext = source.fContext;
    fBranchAddress = source.fBranchAddress;
  }
  return *this;
}

//
//  Method name : operator==
//  Description : Equality operator.  Don't use directly ... demanded by list<>
//
bool
CNonlocalBranch::operator==(const CNonlocalBranch& source) const
{
  return fBranchAddress == source.fBranchAddress;
}

//
//  Method name : operator<
//  Description : Equality operator.  Don't use directly ... demanded by list<>
//
bool
CNonlocalBranch::operator<(const CNonlocalBranch& source) const
{
  return fBranchAddress < source.fBranchAddress;
}