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

Side by Side Diff: runtime/vm/intermediate_language.h

Issue 10392182: Hopefully fixing Windows warnings: fix array member initialization of EmbeddedArray. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_
6 #define VM_INTERMEDIATE_LANGUAGE_H_ 6 #define VM_INTERMEDIATE_LANGUAGE_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/ast.h" 9 #include "vm/ast.h"
10 #include "vm/growable_array.h" 10 #include "vm/growable_array.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 133
134 DISALLOW_COPY_AND_ASSIGN(Computation); 134 DISALLOW_COPY_AND_ASSIGN(Computation);
135 }; 135 };
136 136
137 137
138 // An embedded container with N elements of type T. Used (with partial 138 // An embedded container with N elements of type T. Used (with partial
139 // specialization for N=0) because embedded arrays cannot have size 0. 139 // specialization for N=0) because embedded arrays cannot have size 0.
140 template<typename T, intptr_t N> 140 template<typename T, intptr_t N>
141 class EmbeddedArray { 141 class EmbeddedArray {
142 public: 142 public:
143 EmbeddedArray() : elements_() { } 143 EmbeddedArray() {
144 for (intptr_t i = 0; i < N; i++) elements_[i] = NULL;
145 }
144 146
145 intptr_t length() const { return N; } 147 intptr_t length() const { return N; }
146 const T& operator[](intptr_t i) const { 148 const T& operator[](intptr_t i) const {
147 ASSERT(i < length()); 149 ASSERT(i < length());
148 return elements_[i]; 150 return elements_[i];
149 } 151 }
150 T& operator[](intptr_t i) { 152 T& operator[](intptr_t i) {
151 ASSERT(i < length()); 153 ASSERT(i < length());
152 return elements_[i]; 154 return elements_[i];
153 } 155 }
(...skipping 1652 matching lines...) Expand 10 before | Expand all | Expand 10 after
1806 const GrowableArray<BlockEntryInstr*>& block_order_; 1808 const GrowableArray<BlockEntryInstr*>& block_order_;
1807 1809
1808 private: 1810 private:
1809 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 1811 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
1810 }; 1812 };
1811 1813
1812 1814
1813 } // namespace dart 1815 } // namespace dart
1814 1816
1815 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 1817 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698