OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [go/] [go-location.h] - Blame information for rev 849

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 714 jeremybenn
// go-location.h -- GCC specific Location declaration.   -*- C++ -*-
2
 
3
// Copyright 2011 The Go Authors. All rights reserved.
4
// Use of this source code is governed by a BSD-style
5
// license that can be found in the LICENSE file.
6
 
7
#ifndef GO_LOCATION_H
8
#define GO_LOCATION_H
9
 
10
#include "go-system.h"
11
 
12
// A location in an input source file.
13
 
14
class Location
15
{
16
 public:
17
  Location()
18
    : gcc_loc_(UNKNOWN_LOCATION)
19
  { }
20
 
21
  explicit Location(source_location loc)
22
    : gcc_loc_(loc)
23
  { }
24
 
25
  source_location
26
  gcc_location() const
27
  { return this->gcc_loc_; }
28
 
29
  // Temporary hack till error_at and warning_at can deal with a Location.
30
  operator source_location() const
31
  { return this->gcc_loc_; }
32
 
33
 private:
34
  source_location gcc_loc_;
35
};
36
 
37
// The Go frontend requires the ability to compare Locations.
38
 
39
inline bool
40
operator<(Location loca, Location locb)
41
{
42
  return loca.gcc_location() < locb.gcc_location();
43
}
44
 
45
#endif // !defined(GO_LOCATION_H)

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.