Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: src/compiler/source-position.h

Issue 1088993003: Replace OVERRIDE->override and FINAL->final since we now require C++11. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/simplified-operator-reducer.h ('k') | src/compiler/source-position.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_COMPILER_SOURCE_POSITION_H_ 5 #ifndef V8_COMPILER_SOURCE_POSITION_H_
6 #define V8_COMPILER_SOURCE_POSITION_H_ 6 #define V8_COMPILER_SOURCE_POSITION_H_
7 7
8 #include "src/assembler.h" 8 #include "src/assembler.h"
9 #include "src/compiler/node-aux-data.h" 9 #include "src/compiler/node-aux-data.h"
10 10
11 namespace v8 { 11 namespace v8 {
12 namespace internal { 12 namespace internal {
13 namespace compiler { 13 namespace compiler {
14 14
15 // Encapsulates encoding and decoding of sources positions from which Nodes 15 // Encapsulates encoding and decoding of sources positions from which Nodes
16 // originated. 16 // originated.
17 class SourcePosition FINAL { 17 class SourcePosition final {
18 public: 18 public:
19 explicit SourcePosition(int raw = kUnknownPosition) : raw_(raw) {} 19 explicit SourcePosition(int raw = kUnknownPosition) : raw_(raw) {}
20 20
21 static SourcePosition Unknown() { return SourcePosition(kUnknownPosition); } 21 static SourcePosition Unknown() { return SourcePosition(kUnknownPosition); }
22 bool IsUnknown() const { return raw() == kUnknownPosition; } 22 bool IsUnknown() const { return raw() == kUnknownPosition; }
23 23
24 static SourcePosition Invalid() { return SourcePosition(kInvalidPosition); } 24 static SourcePosition Invalid() { return SourcePosition(kInvalidPosition); }
25 bool IsInvalid() const { return raw() == kInvalidPosition; } 25 bool IsInvalid() const { return raw() == kInvalidPosition; }
26 26
27 int raw() const { return raw_; } 27 int raw() const { return raw_; }
28 28
29 private: 29 private:
30 static const int kInvalidPosition = -2; 30 static const int kInvalidPosition = -2;
31 static const int kUnknownPosition = RelocInfo::kNoPosition; 31 static const int kUnknownPosition = RelocInfo::kNoPosition;
32 STATIC_ASSERT(kInvalidPosition != kUnknownPosition); 32 STATIC_ASSERT(kInvalidPosition != kUnknownPosition);
33 int raw_; 33 int raw_;
34 }; 34 };
35 35
36 36
37 inline bool operator==(const SourcePosition& lhs, const SourcePosition& rhs) { 37 inline bool operator==(const SourcePosition& lhs, const SourcePosition& rhs) {
38 return lhs.raw() == rhs.raw(); 38 return lhs.raw() == rhs.raw();
39 } 39 }
40 40
41 inline bool operator!=(const SourcePosition& lhs, const SourcePosition& rhs) { 41 inline bool operator!=(const SourcePosition& lhs, const SourcePosition& rhs) {
42 return !(lhs == rhs); 42 return !(lhs == rhs);
43 } 43 }
44 44
45 45
46 class SourcePositionTable FINAL { 46 class SourcePositionTable final {
47 public: 47 public:
48 class Scope { 48 class Scope {
49 public: 49 public:
50 Scope(SourcePositionTable* source_positions, SourcePosition position) 50 Scope(SourcePositionTable* source_positions, SourcePosition position)
51 : source_positions_(source_positions), 51 : source_positions_(source_positions),
52 prev_position_(source_positions->current_position_) { 52 prev_position_(source_positions->current_position_) {
53 Init(position); 53 Init(position);
54 } 54 }
55 Scope(SourcePositionTable* source_positions, Node* node) 55 Scope(SourcePositionTable* source_positions, Node* node)
56 : source_positions_(source_positions), 56 : source_positions_(source_positions),
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 NodeAuxData<SourcePosition> table_; 92 NodeAuxData<SourcePosition> table_;
93 93
94 DISALLOW_COPY_AND_ASSIGN(SourcePositionTable); 94 DISALLOW_COPY_AND_ASSIGN(SourcePositionTable);
95 }; 95 };
96 96
97 } // namespace compiler 97 } // namespace compiler
98 } // namespace internal 98 } // namespace internal
99 } // namespace v8 99 } // namespace v8
100 100
101 #endif 101 #endif
OLDNEW
« no previous file with comments | « src/compiler/simplified-operator-reducer.h ('k') | src/compiler/source-position.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698