| OLD | NEW |
| 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_CLASS_FINALIZER_H_ | 5 #ifndef VM_CLASS_FINALIZER_H_ |
| 6 #define VM_CLASS_FINALIZER_H_ | 6 #define VM_CLASS_FINALIZER_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/growable_array.h" | 9 #include "vm/growable_array.h" |
| 10 | 10 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 // type is not tolerated. | 42 // type is not tolerated. |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 // Finalize given type while parsing class cls. | 45 // Finalize given type while parsing class cls. |
| 46 // Also canonicalize type if applicable. | 46 // Also canonicalize type if applicable. |
| 47 static RawAbstractType* FinalizeType(const Class& cls, | 47 static RawAbstractType* FinalizeType(const Class& cls, |
| 48 const AbstractType& type, | 48 const AbstractType& type, |
| 49 FinalizationKind finalization); | 49 FinalizationKind finalization); |
| 50 | 50 |
| 51 // Allocate, finalize, and return a new malformed type as if it was declared | 51 // Allocate, finalize, and return a new malformed type as if it was declared |
| 52 // in class cls at the given token position. Build the error message from the | 52 // in class cls at the given token position. |
| 53 // format string and its arguments. | 53 // If not null, prepend prev_error to the error message built from the format |
| 54 static RawType* NewFinalizedMalformedType(const Class& cls, | 54 // string and its arguments. |
| 55 static RawType* NewFinalizedMalformedType(const Error& prev_error, |
| 56 const Class& cls, |
| 55 intptr_t type_pos, | 57 intptr_t type_pos, |
| 58 FinalizationKind finalization, |
| 56 const char* format, ...) | 59 const char* format, ...) |
| 57 PRINTF_ATTRIBUTE(3, 4); | 60 PRINTF_ATTRIBUTE(5, 6); |
| 58 | 61 |
| 59 // Depending on the given type, finalization mode, and execution mode, mark | 62 // Depending on the given type, finalization mode, and execution mode, mark |
| 60 // the given type as malformed or report a compile time error. | 63 // the given type as malformed or report a compile time error. |
| 61 // If not null, prepend prev_error to the error message built from the format | 64 // If not null, prepend prev_error to the error message built from the format |
| 62 // string and its arguments. | 65 // string and its arguments. |
| 63 static void FinalizeMalformedType(const Error& prev_error, | 66 static void FinalizeMalformedType(const Error& prev_error, |
| 64 const Class& cls, | 67 const Class& cls, |
| 65 const Type& type, | 68 const Type& type, |
| 66 FinalizationKind finalization, | 69 FinalizationKind finalization, |
| 67 const char* format, ...) | 70 const char* format, ...) |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 static void ReportError(const Error& error); | 123 static void ReportError(const Error& error); |
| 121 static void ReportError(const Script& script, | 124 static void ReportError(const Script& script, |
| 122 intptr_t token_index, | 125 intptr_t token_index, |
| 123 const char* format, ...) PRINTF_ATTRIBUTE(3, 4); | 126 const char* format, ...) PRINTF_ATTRIBUTE(3, 4); |
| 124 static void ReportError(const char* format, ...) PRINTF_ATTRIBUTE(1, 2); | 127 static void ReportError(const char* format, ...) PRINTF_ATTRIBUTE(1, 2); |
| 125 }; | 128 }; |
| 126 | 129 |
| 127 } // namespace dart | 130 } // namespace dart |
| 128 | 131 |
| 129 #endif // VM_CLASS_FINALIZER_H_ | 132 #endif // VM_CLASS_FINALIZER_H_ |
| OLD | NEW |