Version 2.14.0-273.0.dev
Merge commit '0f2e58367d3f054fa3aeeb42bff68d7e8197dbcb' into 'dev'
diff --git a/DEPS b/DEPS
index 32a48b1..b72ee61 100644
--- a/DEPS
+++ b/DEPS
@@ -144,12 +144,12 @@
"pub_rev": "3c14d86a67db7207bbc9f654ac49ee60e08e5240",
"pub_semver_rev": "f50d80ef10c4b2fa5f4c8878036a4d9342c0cc82",
"resource_rev": "6b79867d0becf5395e5819a75720963b8298e9a7",
- "root_certificates_rev": "ef7b563890e219a93579b61584f9ffa64c7c8d9c",
+ "root_certificates_rev": "692f6d6488af68e0121317a9c2c9eb393eb0ee50",
"rust_revision": "b7856f695d65a8ebc846754f97d15814bcb1c244",
"shelf_static_rev": "fa30419055279a00c9e428439b1abe362d18f25d",
"shelf_packages_handler_rev": "78302e67c035047e6348e692b0c1182131f0fe35",
"shelf_proxy_tag": "v1.0.0",
- "shelf_rev": "4b9294e29eb308709444a5c0b890fa8ccd69fae4",
+ "shelf_rev": "46483f896cc4308ee3d8e997030ae799b72aa16a",
"shelf_web_socket_rev": "24fb8a04befa75a94ac63a27047b231d1a22aab4",
"source_map_stack_trace_rev": "1c3026f69d9771acf2f8c176a1ab750463309cce",
"source_maps-0.9.4_rev": "38524",
diff --git a/pkg/analysis_server/lib/src/lsp/mapping.dart b/pkg/analysis_server/lib/src/lsp/mapping.dart
index 175033d..429920f 100644
--- a/pkg/analysis_server/lib/src/lsp/mapping.dart
+++ b/pkg/analysis_server/lib/src/lsp/mapping.dart
@@ -1166,8 +1166,8 @@
}
lsp.Range toRange(server.LineInfo lineInfo, int offset, int length) {
- final start = lineInfo.getLocation(offset) as server.CharacterLocation;
- final end = lineInfo.getLocation(offset + length) as server.CharacterLocation;
+ final start = lineInfo.getLocation(offset);
+ final end = lineInfo.getLocation(offset + length);
return lsp.Range(
start: toPosition(start),
diff --git a/pkg/analysis_server/lib/src/lsp/source_edits.dart b/pkg/analysis_server/lib/src/lsp/source_edits.dart
index 39c3cf2..2d3c129 100644
--- a/pkg/analysis_server/lib/src/lsp/source_edits.dart
+++ b/pkg/analysis_server/lib/src/lsp/source_edits.dart
@@ -111,8 +111,7 @@
List<TextEdit> _generateFullEdit(
LineInfo lineInfo, String unformattedSource, String formattedSource) {
- final end =
- lineInfo.getLocation(unformattedSource.length) as CharacterLocation;
+ final end = lineInfo.getLocation(unformattedSource.length);
return [
TextEdit(
range:
@@ -217,9 +216,8 @@
// edits in the same set.
edits.add(TextEdit(
range: Range(
- start:
- toPosition(lineInfo.getLocation(startOffset) as CharacterLocation),
- end: toPosition(lineInfo.getLocation(endOffset) as CharacterLocation),
+ start: toPosition(lineInfo.getLocation(startOffset)),
+ end: toPosition(lineInfo.getLocation(endOffset)),
),
newText: newText,
));
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/create_no_such_method.dart b/pkg/analysis_server/lib/src/services/correction/dart/create_no_such_method.dart
index aa62503..8c93801 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/create_no_such_method.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/create_no_such_method.dart
@@ -30,6 +30,9 @@
}
// append method
builder.write(prefix);
+ builder.write('@override');
+ builder.write(eol);
+ builder.write(prefix);
builder.write(
'noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);');
builder.write(eol);
diff --git a/pkg/analysis_server/lib/src/status/diagnostics.dart b/pkg/analysis_server/lib/src/status/diagnostics.dart
index 10bf891..610be65 100644
--- a/pkg/analysis_server/lib/src/status/diagnostics.dart
+++ b/pkg/analysis_server/lib/src/status/diagnostics.dart
@@ -666,7 +666,7 @@
<nav class="masthead-nav">
<a href="/status" ${isNavPage ? ' class="active"' : ''}>Diagnostics</a>
<a href="/feedback" ${isCurrentPage('/feedback') ? ' class="active"' : ''}>Feedback</a>
- <a href="https://dart.dev/tools/dartanalyzer" target="_blank">Docs</a>
+ <a href="https://dart.dev/tools/dart-analyze" target="_blank">Docs</a>
<a href="https://htmlpreview.github.io/?https://github.com/dart-lang/sdk/blob/master/pkg/analysis_server/doc/api.html" target="_blank">Spec</a>
</nav>
</div>
diff --git a/pkg/analysis_server/test/lsp/server_abstract.dart b/pkg/analysis_server/test/lsp/server_abstract.dart
index 15895e2..6707f2b 100644
--- a/pkg/analysis_server/test/lsp/server_abstract.dart
+++ b/pkg/analysis_server/test/lsp/server_abstract.dart
@@ -1439,7 +1439,7 @@
Position positionFromOffset(int offset, String contents) {
final lineInfo = LineInfo.fromContent(withoutMarkers(contents));
- return toPosition(lineInfo.getLocation(offset) as CharacterLocation);
+ return toPosition(lineInfo.getLocation(offset));
}
Future<RangeAndPlaceholder?> prepareRename(Uri uri, Position pos) {
diff --git a/pkg/analysis_server/test/protocol_server_test.dart b/pkg/analysis_server/test/protocol_server_test.dart
index 2151ba7..49cae54 100644
--- a/pkg/analysis_server/test/protocol_server_test.dart
+++ b/pkg/analysis_server/test/protocol_server_test.dart
@@ -365,9 +365,6 @@
}
@override
- FileResult getFile(String path) => fileResults[path]!;
-
- @override
dynamic noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
}
diff --git a/pkg/analysis_server/test/src/services/correction/fix/create_no_such_method_test.dart b/pkg/analysis_server/test/src/services/correction/fix/create_no_such_method_test.dart
index 19bfb81..00c6398 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/create_no_such_method_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/create_no_such_method_test.dart
@@ -39,6 +39,7 @@
class B extends A {
existing() {}
+ @override
noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
}
''');
diff --git a/pkg/analyzer/CHANGELOG.md b/pkg/analyzer/CHANGELOG.md
index d29f53d..dfc8654 100644
--- a/pkg/analyzer/CHANGELOG.md
+++ b/pkg/analyzer/CHANGELOG.md
@@ -1,3 +1,17 @@
+## 2.0.0-dev (Not yet released - breaking changes)
+* Removed deprecated `Scope.lookup2()`.
+* Removed deprecated setters in API of AST.
+* Removed deprecated `FunctionTypeAliasElement`.
+* Updated `LineInfo.getLocation()` to return `CharacterLocation`.
+* Removed deprecated `LineInfo_Location`.
+* Removed deprecated methods from `AnalysisSession`.
+* Changed `DartObject.type` from `ParameterizedType?` to `DartType?`.
+* Changed `FunctionType` to implement `DartType`, not `ParameterizedType`.
+* Removed `FunctionType.element` and `FunctionType.typeArguments`.
+* Changed `DartObject.type` from `ParameterizedType?` to `DartType?`.
+* Changed `FunctionType` to implement `DartType`, not `ParameterizedType`.
+* Removed `FunctionType.element` and `FunctionType.typeArguments`.
+
## 1.8.0-dev
* Added `StringInterpolation.firstString` and `lastString`, to express
explicitly that there are always (possibly empty) strings as the first
diff --git a/pkg/analyzer/lib/dart/analysis/session.dart b/pkg/analyzer/lib/dart/analysis/session.dart
index 2f6aa40..680ba37 100644
--- a/pkg/analyzer/lib/dart/analysis/session.dart
+++ b/pkg/analyzer/lib/dart/analysis/session.dart
@@ -9,7 +9,6 @@
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/exception/exception.dart';
import 'package:analyzer/file_system/file_system.dart';
-import 'package:analyzer/src/generated/source.dart';
/// A consistent view of the results of analyzing one or more files.
///
@@ -36,136 +35,48 @@
///
/// If the file cannot be analyzed by this session, then the result will have
/// a result state indicating the nature of the problem.
- @Deprecated('Use getErrors2() instead')
- Future<ErrorsResult> getErrors(String path);
-
- /// Return a future that will complete with information about the errors
- /// contained in the file with the given absolute, normalized [path].
- ///
- /// If the file cannot be analyzed by this session, then the result will have
- /// a result state indicating the nature of the problem.
Future<SomeErrorsResult> getErrors2(String path);
/// Return information about the file at the given absolute, normalized
/// [path].
- @Deprecated('Use getFile2() instead')
- FileResult getFile(String path);
-
- /// Return information about the file at the given absolute, normalized
- /// [path].
SomeFileResult getFile2(String path);
- /// Return a future that will complete with the library element representing
- /// the library with the given [uri].
- @Deprecated('Use getLibraryByUri2() instead')
- Future<LibraryElement> getLibraryByUri(String uri);
-
/// Return a future that will complete with information about the library
/// element representing the library with the given [uri].
Future<SomeLibraryElementResult> getLibraryByUri2(String uri);
/// Return information about the results of parsing units of the library file
/// with the given absolute, normalized [path].
- ///
- /// Throw [ArgumentError] if the given [path] is not the defining compilation
- /// unit for a library (that is, is a part of a library).
- @Deprecated('Use getParsedLibrary2() instead')
- ParsedLibraryResult getParsedLibrary(String path);
-
- /// Return information about the results of parsing units of the library file
- /// with the given absolute, normalized [path].
SomeParsedLibraryResult getParsedLibrary2(String path);
/// Return information about the results of parsing units of the library file
/// with the given library [element].
- ///
- /// Throw [ArgumentError] if the [element] was not produced by this session.
- @Deprecated('Use getParsedLibraryByElement2() instead')
- ParsedLibraryResult getParsedLibraryByElement(LibraryElement element);
-
- /// Return information about the results of parsing units of the library file
- /// with the given library [element].
SomeParsedLibraryResult getParsedLibraryByElement2(LibraryElement element);
/// Return information about the results of parsing the file with the given
/// absolute, normalized [path].
- @Deprecated('Use getParsedUnit2() instead')
- ParsedUnitResult getParsedUnit(String path);
-
- /// Return information about the results of parsing the file with the given
- /// absolute, normalized [path].
SomeParsedUnitResult getParsedUnit2(String path);
/// Return a future that will complete with information about the results of
/// resolving all of the files in the library with the given absolute,
/// normalized [path].
- ///
- /// Throw [ArgumentError] if the given [path] is not the defining compilation
- /// unit for a library (that is, is a part of a library).
- @Deprecated('Use getResolvedLibrary2() instead')
- Future<ResolvedLibraryResult> getResolvedLibrary(String path);
-
- /// Return a future that will complete with information about the results of
- /// resolving all of the files in the library with the given absolute,
- /// normalized [path].
Future<SomeResolvedLibraryResult> getResolvedLibrary2(String path);
/// Return a future that will complete with information about the results of
/// resolving all of the files in the library with the library [element].
///
/// Throw [ArgumentError] if the [element] was not produced by this session.
- @Deprecated('Use getResolvedLibraryByElement2() instead')
- Future<ResolvedLibraryResult> getResolvedLibraryByElement(
- LibraryElement element);
-
- /// Return a future that will complete with information about the results of
- /// resolving all of the files in the library with the library [element].
- ///
- /// Throw [ArgumentError] if the [element] was not produced by this session.
Future<SomeResolvedLibraryResult> getResolvedLibraryByElement2(
LibraryElement element);
/// Return a future that will complete with information about the results of
/// resolving the file with the given absolute, normalized [path].
- @Deprecated('Use getResolvedUnit2() instead')
- Future<ResolvedUnitResult> getResolvedUnit(String path);
-
- /// Return a future that will complete with information about the results of
- /// resolving the file with the given absolute, normalized [path].
Future<SomeResolvedUnitResult> getResolvedUnit2(String path);
- /// Return a future that will complete with the source kind of the file with
- /// the given absolute, normalized [path]. If the path does not represent a
- /// file or if the kind of the file cannot be determined, then the future will
- /// complete with [SourceKind.UNKNOWN].
- ///
- /// TODO(migration): should not be nullable
- @Deprecated('Use getFile2() instead')
- Future<SourceKind?> getSourceKind(String path);
-
- /// Return a future that will complete with information about the results of
- /// building the element model for the file with the given absolute,
- /// normalized [path].
- @Deprecated('Use getUnitElement2() instead')
- Future<UnitElementResult> getUnitElement(String path);
-
/// Return a future that will complete with information about the results of
/// building the element model for the file with the given absolute,
/// normalized [path].
Future<SomeUnitElementResult> getUnitElement2(String path);
-
- /// Return a future that will complete with the signature for the file with
- /// the given absolute, normalized [path], or `null` if the file cannot be
- /// analyzed. This is the same signature returned in the result from
- /// [getUnitElement2].
- ///
- /// The signature is based on the APIs of the files of the library (including
- /// the file itself), and the transitive closure of files imported and
- /// exported by the library. If the signature of a file has not changed, then
- /// there have been no changes that would cause any files that depend on it to
- /// need to be re-analyzed.
- @Deprecated('This method is not used and will be removed')
- Future<String> getUnitElementSignature(String path);
}
/// The exception thrown by an [AnalysisSession] if a result is requested that
diff --git a/pkg/analyzer/lib/dart/analysis/utilities.dart b/pkg/analyzer/lib/dart/analysis/utilities.dart
index 50e0677..3fd296d 100644
--- a/pkg/analyzer/lib/dart/analysis/utilities.dart
+++ b/pkg/analyzer/lib/dart/analysis/utilities.dart
@@ -111,23 +111,6 @@
/// Note that if more than one file is going to be resolved then this function
/// is inefficient. Clients should instead use [AnalysisContextCollection] to
/// create one or more contexts and use those contexts to resolve the files.
-///
-/// TODO(migration): should not be nullable
-@Deprecated('Use resolveFile2() instead')
-Future<ResolvedUnitResult?> resolveFile(
- {required String path, ResourceProvider? resourceProvider}) async {
- AnalysisContext context =
- _createAnalysisContext(path: path, resourceProvider: resourceProvider);
- return await context.currentSession.getResolvedUnit(path);
-}
-
-/// Return the result of resolving the file at the given [path].
-///
-/// If a [resourceProvider] is given, it will be used to access the file system.
-///
-/// Note that if more than one file is going to be resolved then this function
-/// is inefficient. Clients should instead use [AnalysisContextCollection] to
-/// create one or more contexts and use those contexts to resolve the files.
Future<SomeResolvedUnitResult> resolveFile2(
{required String path, ResourceProvider? resourceProvider}) async {
AnalysisContext context =
diff --git a/pkg/analyzer/lib/dart/ast/ast.dart b/pkg/analyzer/lib/dart/ast/ast.dart
index 0079659..ab82e26 100644
--- a/pkg/analyzer/lib/dart/ast/ast.dart
+++ b/pkg/analyzer/lib/dart/ast/ast.dart
@@ -40,7 +40,6 @@
import 'package:analyzer/dart/element/type.dart';
import 'package:analyzer/src/generated/java_engine.dart';
import 'package:analyzer/src/generated/source.dart' show LineInfo, Source;
-import 'package:analyzer/src/generated/utilities_dart.dart';
/// Two or more string literals that are implicitly concatenated because of
/// being adjacent (separated only by whitespace).
@@ -67,11 +66,6 @@
/// this node does not have a documentation comment associated with it.
Comment? get documentationComment;
- /// Set the documentation comment associated with this node to the given
- /// [comment].
- @Deprecated('Clients should not build AST manually')
- set documentationComment(Comment? comment);
-
/// Return the first token following the comment and metadata.
Token get firstTokenAfterCommentAndMetadata;
@@ -102,53 +96,26 @@
/// annotation is not the invocation of a constructor.
ArgumentList? get arguments;
- /// Set the arguments to the constructor being invoked to the given
- /// [arguments].
- @Deprecated('Clients should not build AST manually')
- set arguments(ArgumentList? arguments);
-
/// Return the at sign that introduced the annotation.
Token get atSign;
- /// Set the at sign that introduced the annotation to the given [token].
- @Deprecated('Clients should not build AST manually')
- set atSign(Token token);
-
/// Return the name of the constructor being invoked, or `null` if this
/// annotation is not the invocation of a named constructor.
SimpleIdentifier? get constructorName;
- /// Set the name of the constructor being invoked to the given [name].
- @Deprecated('Clients should not build AST manually')
- set constructorName(SimpleIdentifier? name);
-
/// Return the element associated with this annotation, or `null` if the AST
/// structure has not been resolved or if this annotation could not be
/// resolved.
Element? get element;
- /// Set the element associated with this annotation to the given [element].
- @Deprecated('Clients should not build AST manually')
- set element(Element? element);
-
/// Return the element annotation representing this annotation in the element
/// model; `null` when the AST has not been resolved.
ElementAnnotation? get elementAnnotation;
- /// Set the element annotation representing this annotation in the element
- /// model to the given [annotation].
- @Deprecated('Clients should not build AST manually')
- set elementAnnotation(ElementAnnotation? annotation);
-
/// Return the name of the class defining the constructor that is being
/// invoked or the name of the field that is being referenced.
Identifier get name;
- /// Set the name of the class defining the constructor that is being invoked
- /// or the name of the field that is being referenced to the given [name].
- @Deprecated('Clients should not build AST manually')
- set name(Identifier name);
-
@override
AstNode get parent;
@@ -156,10 +123,6 @@
/// annotation is not the invocation of a named constructor.
Token? get period;
- /// Set the period before the constructor name to the given [token].
- @Deprecated('Clients should not build AST manually')
- set period(Token? token);
-
/// Returns the type arguments to the constructor being invoked, or `null` if
/// (a) this annotation is not the invocation of a constructor or (b) this
/// annotation does not specify type arguments explicitly.
@@ -187,26 +150,11 @@
/// named arguments, this class allows them to be intermixed.
NodeList<Expression> get arguments;
- /// Set the parameter elements corresponding to each of the arguments in this
- /// list to the given list of [parameters]. The list of parameters must be the
- /// same length as the number of arguments, but can contain `null` entries if
- /// a given argument does not correspond to a formal parameter.
- @Deprecated('Clients should not build AST manually')
- set correspondingStaticParameters(List<ParameterElement?> parameters);
-
/// Return the left parenthesis.
Token get leftParenthesis;
- /// Set the left parenthesis to the given [token].
- @Deprecated('Clients should not build AST manually')
- set leftParenthesis(Token token);
-
/// Return the right parenthesis.
Token get rightParenthesis;
-
- /// Set the right parenthesis to the given [token].
- @Deprecated('Clients should not build AST manually')
- set rightParenthesis(Token token);
}
/// An as expression.
@@ -219,24 +167,11 @@
/// Return the 'as' operator.
Token get asOperator;
- /// Set the 'as' operator to the given [token].
- @Deprecated('Clients should not build AST manually')
- set asOperator(Token token);
-
/// Return the expression used to compute the value being cast.
Expression get expression;
- /// Set the expression used to compute the value being cast to the given
- /// [expression].
- @Deprecated('Clients should not build AST manually')
- set expression(Expression expression);
-
/// Return the type being cast to.
TypeAnnotation get type;
-
- /// Set the type being cast to to the given [type].
- @Deprecated('Clients should not build AST manually')
- set type(TypeAnnotation type);
}
/// An assert in the initializer list of a constructor.
@@ -254,49 +189,22 @@
/// Return the token representing the 'assert' keyword.
Token get assertKeyword;
- /// Set the token representing the 'assert' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set assertKeyword(Token token);
-
/// Return the comma between the [condition] and the [message], or `null` if
/// no message was supplied.
Token? get comma;
- /// Set the comma between the [condition] and the [message] to the given
- /// [token].
- @Deprecated('Clients should not build AST manually')
- set comma(Token? token);
-
/// Return the condition that is being asserted to be `true`.
Expression get condition;
- /// Set the condition that is being asserted to be `true` to the given
- /// [condition].
- @Deprecated('Clients should not build AST manually')
- set condition(Expression condition);
-
/// Return the left parenthesis.
Token get leftParenthesis;
- /// Set the left parenthesis to the given [token].
- @Deprecated('Clients should not build AST manually')
- set leftParenthesis(Token token);
-
/// Return the message to report if the assertion fails, or `null` if no
/// message was supplied.
Expression? get message;
- /// Set the message to report if the assertion fails to the given
- /// [expression].
- @Deprecated('Clients should not build AST manually')
- set message(Expression? expression);
-
/// Return the right parenthesis.
Token get rightParenthesis;
-
- /// Set the right parenthesis to the given [token].
- @Deprecated('Clients should not build AST manually')
- set rightParenthesis(Token token);
}
/// An assert statement.
@@ -308,10 +216,6 @@
abstract class AssertStatement implements Assertion, Statement {
/// Return the semicolon terminating the statement.
Token get semicolon;
-
- /// Set the semicolon terminating the statement to the given [token].
- @Deprecated('Clients should not build AST manually')
- set semicolon(Token token);
}
/// An assignment expression.
@@ -328,24 +232,11 @@
/// Return the expression used to compute the left hand side.
Expression get leftHandSide;
- /// Return the expression used to compute the left hand side.
- @Deprecated('Clients should not build AST manually')
- set leftHandSide(Expression expression);
-
/// Return the assignment operator being applied.
Token get operator;
- /// Set the assignment operator being applied to the given [token].
- @Deprecated('Clients should not build AST manually')
- set operator(Token token);
-
/// Return the expression used to compute the right hand side.
Expression get rightHandSide;
-
- /// Set the expression used to compute the left hand side to the given
- /// [expression].
- @Deprecated('Clients should not build AST manually')
- set rightHandSide(Expression expression);
}
/// A node in the AST structure for a Dart program.
@@ -718,17 +609,8 @@
/// Return the 'await' keyword.
Token get awaitKeyword;
- /// Set the 'await' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set awaitKeyword(Token token);
-
/// Return the expression whose value is being waited on.
Expression get expression;
-
- /// Set the expression whose value is being waited on to the given
- /// [expression].
- @Deprecated('Clients should not build AST manually')
- set expression(Expression expression);
}
/// A binary (infix) expression.
@@ -742,33 +624,15 @@
/// Return the expression used to compute the left operand.
Expression get leftOperand;
- /// Set the expression used to compute the left operand to the given
- /// [expression].
- @Deprecated('Clients should not build AST manually')
- set leftOperand(Expression expression);
-
/// Return the binary operator being applied.
Token get operator;
- /// Set the binary operator being applied to the given [token].
- @Deprecated('Clients should not build AST manually')
- set operator(Token token);
-
/// Return the expression used to compute the right operand.
Expression get rightOperand;
- /// Set the expression used to compute the right operand to the given
- /// [expression].
- @Deprecated('Clients should not build AST manually')
- set rightOperand(Expression expression);
-
/// The function type of the invocation, or `null` if the AST structure has
/// not been resolved, or if the invocation could not be resolved.
FunctionType? get staticInvokeType;
-
- /// Sets the function type of the invocation.
- @Deprecated('Clients should not build AST manually')
- set staticInvokeType(FunctionType? value);
}
/// A sequence of statements.
@@ -781,17 +645,9 @@
/// Return the left curly bracket.
Token get leftBracket;
- /// Set the left curly bracket to the given [token].
- @Deprecated('Clients should not build AST manually')
- set leftBracket(Token token);
-
/// Return the right curly bracket.
Token get rightBracket;
- /// Set the right curly bracket to the given [token].
- @Deprecated('Clients should not build AST manually')
- set rightBracket(Token token);
-
/// Return the statements contained in the block.
NodeList<Statement> get statements;
}
@@ -805,18 +661,6 @@
abstract class BlockFunctionBody implements FunctionBody {
/// Return the block representing the body of the function.
Block get block;
-
- /// Set the block representing the body of the function to the given [block].
- @Deprecated('Clients should not build AST manually')
- set block(Block block);
-
- /// Set token representing the 'async' or 'sync' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set keyword(Token? token);
-
- /// Set the star following the 'async' or 'sync' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set star(Token? token);
}
/// A boolean literal expression.
@@ -829,10 +673,6 @@
/// Return the token representing the literal.
Token get literal;
- /// Set the token representing the literal to the given [token].
- @Deprecated('Clients should not build AST manually')
- set literal(Token token);
-
/// Return the value of the literal.
bool get value;
}
@@ -847,25 +687,13 @@
/// Return the token representing the 'break' keyword.
Token get breakKeyword;
- /// Set the token representing the 'break' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set breakKeyword(Token token);
-
/// Return the label associated with the statement, or `null` if there is no
/// label.
SimpleIdentifier? get label;
- /// Set the label associated with the statement to the given [identifier].
- @Deprecated('Clients should not build AST manually')
- set label(SimpleIdentifier? identifier);
-
/// Return the semicolon terminating the statement.
Token get semicolon;
- /// Set the semicolon terminating the statement to the given [token].
- @Deprecated('Clients should not build AST manually')
- set semicolon(Token token);
-
/// Return the node from which this break statement is breaking.
///
/// This will be either a [Statement] (in the case of breaking out of a
@@ -875,11 +703,6 @@
/// be resolved. Note that if the source code has errors, the target might be
/// invalid (e.g. trying to break to a switch case).
AstNode? get target;
-
- /// Set the node from which this break statement is breaking to the given
- /// [node].
- @Deprecated('Clients should not build AST manually')
- set target(AstNode? node);
}
/// A sequence of cascaded expressions: expressions that share a common target.
@@ -910,10 +733,6 @@
/// Return the target of the cascade sections.
Expression get target;
-
- /// Set the target of the cascade sections to the given [target].
- @Deprecated('Clients should not build AST manually')
- set target(Expression target);
}
/// A catch clause within a try statement.
@@ -930,75 +749,35 @@
/// Return the body of the catch block.
Block get body;
- /// Set the body of the catch block to the given [block].
- @Deprecated('Clients should not build AST manually')
- set body(Block block);
-
/// Return the token representing the 'catch' keyword, or `null` if there is
/// no 'catch' keyword.
Token? get catchKeyword;
- /// Set the token representing the 'catch' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set catchKeyword(Token? token);
-
/// Return the comma separating the exception parameter from the stack trace
/// parameter, or `null` if there is no stack trace parameter.
Token? get comma;
- /// Set the comma separating the exception parameter from the stack trace
- /// parameter to the given [token].
- @Deprecated('Clients should not build AST manually')
- set comma(Token? token);
-
/// Return the parameter whose value will be the exception that was thrown, or
/// `null` if there is no 'catch' keyword.
SimpleIdentifier? get exceptionParameter;
- /// Set the parameter whose value will be the exception that was thrown to the
- /// given [parameter].
- @Deprecated('Clients should not build AST manually')
- set exceptionParameter(SimpleIdentifier? parameter);
-
/// Return the type of exceptions caught by this catch clause, or `null` if
/// this catch clause catches every type of exception.
TypeAnnotation? get exceptionType;
- /// Set the type of exceptions caught by this catch clause to the given
- /// [exceptionType].
- @Deprecated('Clients should not build AST manually')
- set exceptionType(TypeAnnotation? exceptionType);
-
/// Return the left parenthesis, or `null` if there is no 'catch' keyword.
Token? get leftParenthesis;
- /// Set the left parenthesis to the given [token].
- @Deprecated('Clients should not build AST manually')
- set leftParenthesis(Token? token);
-
/// Return the token representing the 'on' keyword, or `null` if there is no
/// 'on' keyword.
Token? get onKeyword;
- /// Set the token representing the 'on' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set onKeyword(Token? token);
-
/// Return the right parenthesis, or `null` if there is no 'catch' keyword.
Token? get rightParenthesis;
- /// Set the right parenthesis to the given [token].
- @Deprecated('Clients should not build AST manually')
- set rightParenthesis(Token? token);
-
/// Return the parameter whose value will be the stack trace associated with
/// the exception, or `null` if there is no stack trace parameter.
SimpleIdentifier? get stackTraceParameter;
-
- /// Set the parameter whose value will be the stack trace associated with the
- /// exception to the given [parameter].
- @Deprecated('Clients should not build AST manually')
- set stackTraceParameter(SimpleIdentifier? parameter);
}
/// The declaration of a class.
@@ -1014,61 +793,24 @@
/// Return the 'abstract' keyword, or `null` if the keyword was absent.
Token? get abstractKeyword;
- /// Set the 'abstract' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set abstractKeyword(Token? token);
-
/// Return the token representing the 'class' keyword.
Token get classKeyword;
- /// Set the token representing the 'class' keyword.
- @Deprecated('Clients should not build AST manually')
- set classKeyword(Token token);
-
/// Return the extends clause for this class, or `null` if the class does not
/// extend any other class.
ExtendsClause? get extendsClause;
- /// Set the extends clause for this class to the given [extendsClause].
- @Deprecated('Clients should not build AST manually')
- set extendsClause(ExtendsClause? extendsClause);
-
- /// Set the implements clause for the class to the given [implementsClause].
- @Deprecated('Clients should not build AST manually')
- set implementsClause(ImplementsClause? implementsClause);
-
/// Return `true` if this class is declared to be an abstract class.
bool get isAbstract;
- /// Set the left curly bracket to the given [token].
- @Deprecated('Clients should not build AST manually')
- set leftBracket(Token token);
-
/// Return the native clause for this class, or `null` if the class does not
/// have a native clause.
NativeClause? get nativeClause;
- /// Set the native clause for this class to the given [nativeClause].
- @Deprecated('Clients should not build AST manually')
- set nativeClause(NativeClause? nativeClause);
-
- /// Set the right curly bracket to the given [token].
- @Deprecated('Clients should not build AST manually')
- set rightBracket(Token token);
-
- /// Set the type parameters for the class to the given list of
- /// [typeParameters].
- @Deprecated('Clients should not build AST manually')
- set typeParameters(TypeParameterList? typeParameters);
-
/// Return the with clause for the class, or `null` if the class does not have
/// a with clause.
WithClause? get withClause;
- /// Set the with clause for the class to the given [withClause].
- @Deprecated('Clients should not build AST manually')
- set withClause(WithClause? withClause);
-
/// Return the constructor declared in the class with the given [name], or
/// `null` if there is no such constructor.
///
@@ -1135,29 +877,16 @@
/// defining an abstract class.
Token? get abstractKeyword;
- /// Set the token for the 'abstract' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set abstractKeyword(Token? token);
-
@override
ClassElement? get declaredElement;
/// Return the token for the '=' separating the name from the definition.
Token get equals;
- /// Set the token for the '=' separating the name from the definition to the
- /// given [token].
- @Deprecated('Clients should not build AST manually')
- set equals(Token token);
-
/// Return the implements clause for this class, or `null` if there is no
/// implements clause.
ImplementsClause? get implementsClause;
- /// Set the implements clause for this class to the given [implementsClause].
- @Deprecated('Clients should not build AST manually')
- set implementsClause(ImplementsClause? implementsClause);
-
/// Return `true` if this class is declared to be an abstract class.
bool get isAbstract;
@@ -1167,26 +896,12 @@
/// Return the name of the superclass of the class being declared.
TypeName get superclass;
- /// Set the name of the superclass of the class being declared to the given
- /// [superclass] name.
- @Deprecated('Clients should not build AST manually')
- set superclass(TypeName superclass);
-
/// Return the type parameters for the class, or `null` if the class does not
/// have any type parameters.
TypeParameterList? get typeParameters;
- /// Set the type parameters for the class to the given list of
- /// [typeParameters].
- @Deprecated('Clients should not build AST manually')
- set typeParameters(TypeParameterList? typeParameters);
-
/// Return the with clause for this class.
WithClause get withClause;
-
- /// Set the with clause for this class to the given with [withClause].
- @Deprecated('Clients should not build AST manually')
- set withClause(WithClause withClause);
}
/// An element in a list, map or set literal.
@@ -1212,11 +927,6 @@
/// Return the 'hide' or 'show' keyword specifying what kind of processing is
/// to be done on the names.
Token get keyword;
-
- /// Set the 'hide' or 'show' keyword specifying what kind of processing is
- /// to be done on the names to the given [token].
- @Deprecated('Clients should not build AST manually')
- set keyword(Token token);
}
/// A comment within the source code.
@@ -1264,17 +974,9 @@
/// Return the identifier being referenced.
Identifier get identifier;
- /// Set the identifier being referenced to the given [identifier].
- @Deprecated('Clients should not build AST manually')
- set identifier(Identifier identifier);
-
/// Return the token representing the 'new' keyword, or `null` if there was no
/// 'new' keyword.
Token? get newKeyword;
-
- /// Set the token representing the 'new' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set newKeyword(Token? token);
}
/// A compilation unit.
@@ -1301,11 +1003,6 @@
///
/// Clients may not extend, implement or mix-in this class.
abstract class CompilationUnit implements AstNode {
- /// Set the first token included in this node's source range to the given
- /// [token].
- @Deprecated('Clients should not build AST manually')
- set beginToken(Token token);
-
/// Return the declarations contained in this compilation unit.
NodeList<CompilationUnitMember> get declarations;
@@ -1316,16 +1013,6 @@
/// Return the directives contained in this compilation unit.
NodeList<Directive> get directives;
- /// Set the element associated with this compilation unit to the given
- /// [element].
- @Deprecated('Clients should not build AST manually')
- set element(CompilationUnitElement? element);
-
- /// Set the last token included in this node's source range to the given
- /// [token].
- @Deprecated('Clients should not build AST manually')
- set endToken(Token token);
-
/// The set of features available to this compilation unit.
///
/// Determined by some combination of the .packages file, the enclosing
@@ -1340,19 +1027,10 @@
/// Return the line information for this compilation unit.
LineInfo? get lineInfo;
- /// Set the line information for this compilation unit to the given [info].
- @Deprecated('Clients should not build AST manually')
- set lineInfo(LineInfo? info);
-
/// Return the script tag at the beginning of the compilation unit, or `null`
/// if there is no script tag in this compilation unit.
ScriptTag? get scriptTag;
- /// Set the script tag at the beginning of the compilation unit to the given
- /// [scriptTag].
- @Deprecated('Clients should not build AST manually')
- set scriptTag(ScriptTag? scriptTag);
-
/// Return a list containing all of the directives and declarations in this
/// compilation unit, sorted in lexical order.
List<AstNode> get sortedDirectivesAndDeclarations;
@@ -1443,45 +1121,20 @@
/// expression.
Token get colon;
- /// Set the token used to separate the then expression from the else
- /// expression to the given [token].
- @Deprecated('Clients should not build AST manually')
- set colon(Token token);
-
/// Return the condition used to determine which of the expressions is
/// executed next.
Expression get condition;
- /// Set the condition used to determine which of the expressions is executed
- /// next to the given [expression].
- @Deprecated('Clients should not build AST manually')
- set condition(Expression expression);
-
/// Return the expression that is executed if the condition evaluates to
/// `false`.
Expression get elseExpression;
- /// Set the expression that is executed if the condition evaluates to `false`
- /// to the given [expression].
- @Deprecated('Clients should not build AST manually')
- set elseExpression(Expression expression);
-
/// Return the token used to separate the condition from the then expression.
Token get question;
- /// Set the token used to separate the condition from the then expression to
- /// the given [token].
- @Deprecated('Clients should not build AST manually')
- set question(Token token);
-
/// Return the expression that is executed if the condition evaluates to
/// `true`.
Expression get thenExpression;
-
- /// Set the expression that is executed if the condition evaluates to `true`
- /// to the given [expression].
- @Deprecated('Clients should not build AST manually')
- set thenExpression(Expression expression);
}
/// A configuration in either an import or export directive.
@@ -1501,64 +1154,29 @@
/// not include an equality test.
Token? get equalToken;
- /// Set the token for the equal operator to the given [token].
- @Deprecated('Clients should not build AST manually')
- set equalToken(Token? token);
-
/// Return the token for the 'if' keyword.
Token get ifKeyword;
- /// Set the token for the 'if' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set ifKeyword(Token token);
-
/// Return the token for the left parenthesis.
Token get leftParenthesis;
- /// Set the token for the left parenthesis to the given [token].
- @Deprecated('Clients should not build AST manually')
- set leftParenthesis(Token token);
-
/// Return the name of the declared variable whose value is being used in the
/// condition.
DottedName get name;
- /// Set the name of the declared variable whose value is being used in the
- /// condition to the given [name].
- @Deprecated('Clients should not build AST manually')
- set name(DottedName name);
-
/// Return the token for the right parenthesis.
Token get rightParenthesis;
- /// Set the token for the right parenthesis to the given [token].
- @Deprecated('Clients should not build AST manually')
- set rightParenthesis(Token token);
-
/// Return the URI of the implementation library to be used if the condition
/// is true.
StringLiteral get uri;
- /// Set the URI of the implementation library to be used if the condition is
- /// true to the given [uri].
- @Deprecated('Clients should not build AST manually')
- set uri(StringLiteral uri);
-
/// Return the source to which the [uri] was resolved.
Source? get uriSource;
- /// Set the source to which the [uri] was resolved to the given [source].
- @Deprecated('Clients should not build AST manually')
- set uriSource(Source? source);
-
/// Return the value to which the value of the declared variable will be
/// compared, or `null` if the condition does not include an equality test.
StringLiteral? get value;
-
- /// Set the value to which the value of the declared variable will be
- /// compared to the given [value].
- @Deprecated('Clients should not build AST manually')
- set value(StringLiteral? value);
}
/// A constructor declaration.
@@ -1586,37 +1204,20 @@
/// Return the body of the constructor.
FunctionBody get body;
- /// Set the body of the constructor to the given [functionBody].
- @Deprecated('Clients should not build AST manually')
- set body(FunctionBody functionBody);
-
/// Return the token for the 'const' keyword, or `null` if the constructor is
/// not a const constructor.
Token? get constKeyword;
- /// Set the token for the 'const' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set constKeyword(Token? token);
-
@override
ConstructorElement? get declaredElement;
/// Return the token for the 'external' keyword to the given [token].
Token? get externalKeyword;
- /// Set the token for the 'external' keyword, or `null` if the constructor
- /// is not external.
- @Deprecated('Clients should not build AST manually')
- set externalKeyword(Token? token);
-
/// Return the token for the 'factory' keyword, or `null` if the constructor
/// is not a factory constructor.
Token? get factoryKeyword;
- /// Set the token for the 'factory' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set factoryKeyword(Token? token);
-
/// Return the initializers associated with the constructor.
NodeList<ConstructorInitializer> get initializers;
@@ -1624,36 +1225,17 @@
/// declared is unnamed.
SimpleIdentifier? get name;
- /// Set the name of the constructor to the given [identifier].
- @Deprecated('Clients should not build AST manually')
- set name(SimpleIdentifier? identifier);
-
/// Return the parameters associated with the constructor.
FormalParameterList get parameters;
- /// Set the parameters associated with the constructor to the given list of
- /// [parameters].
- @Deprecated('Clients should not build AST manually')
- set parameters(FormalParameterList parameters);
-
/// Return the token for the period before the constructor name, or `null` if
/// the constructor being declared is unnamed.
Token? get period;
- /// Set the token for the period before the constructor name to the given
- /// [token].
- @Deprecated('Clients should not build AST manually')
- set period(Token? token);
-
/// Return the name of the constructor to which this constructor will be
/// redirected, or `null` if this is not a redirecting factory constructor.
ConstructorName? get redirectedConstructor;
- /// Set the name of the constructor to which this constructor will be
- /// redirected to the given [redirectedConstructor] name.
- @Deprecated('Clients should not build AST manually')
- set redirectedConstructor(ConstructorName? redirectedConstructor);
-
/// Return the type of object being created.
///
/// This can be different than the type in which the constructor is being
@@ -1661,18 +1243,9 @@
/// constructor.
Identifier get returnType;
- /// Set the type of object being created to the given [typeName].
- @Deprecated('Clients should not build AST manually')
- set returnType(Identifier typeName);
-
/// Return the token for the separator (colon or equals) before the
/// initializer list or redirection, or `null` if there are no initializers.
Token? get separator;
-
- /// Set the token for the separator (colon or equals) before the initializer
- /// list or redirection to the given [token].
- @Deprecated('Clients should not build AST manually')
- set separator(Token? token);
}
/// The initialization of a field within a constructor's initialization list.
@@ -1686,43 +1259,20 @@
/// expression.
Token get equals;
- /// Set the token for the equal sign between the field name and the
- /// expression to the given [token].
- @Deprecated('Clients should not build AST manually')
- set equals(Token token);
-
/// Return the expression computing the value to which the field will be
/// initialized.
Expression get expression;
- /// Set the expression computing the value to which the field will be
- /// initialized to the given [expression].
- @Deprecated('Clients should not build AST manually')
- set expression(Expression expression);
-
/// Return the name of the field being initialized.
SimpleIdentifier get fieldName;
- /// Set the name of the field being initialized to the given [identifier].
- @Deprecated('Clients should not build AST manually')
- set fieldName(SimpleIdentifier identifier);
-
/// Return the token for the period after the 'this' keyword, or `null` if
/// there is no 'this' keyword.
Token? get period;
- /// Set the token for the period after the 'this' keyword to the given
- /// [token].
- @Deprecated('Clients should not build AST manually')
- set period(Token? token);
-
/// Return the token for the 'this' keyword, or `null` if there is no 'this'
/// keyword.
Token? get thisKeyword;
-
- /// Set the token for the 'this' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set thisKeyword(Token? token);
}
/// A node that can occur in the initializer list of a constructor declaration.
@@ -1746,26 +1296,12 @@
/// is the unnamed constructor.
SimpleIdentifier? get name;
- /// Set the name of the constructor to the given [name].
- @Deprecated('Clients should not build AST manually')
- set name(SimpleIdentifier? name);
-
/// Return the token for the period before the constructor name, or `null` if
/// the specified constructor is the unnamed constructor.
Token? get period;
- /// Set the token for the period before the constructor name to the given
- /// [token].
- @Deprecated('Clients should not build AST manually')
- set period(Token? token);
-
/// Return the name of the type defining the constructor.
TypeName get type;
-
- /// Set the name of the type defining the constructor to the given [type]
- /// name.
- @Deprecated('Clients should not build AST manually')
- set type(TypeName type);
}
/// An expression representing a reference to a constructor, e.g. the expression
@@ -1789,11 +1325,6 @@
/// static type information, or `null` if the AST structure has not been
/// resolved or if the constructor could not be resolved.
ConstructorElement? get staticElement;
-
- /// Set the element associated with the referenced constructor based on static
- /// type information to the given [element].
- @Deprecated('Clients should not build AST manually')
- set staticElement(ConstructorElement? element);
}
/// A continue statement.
@@ -1806,25 +1337,13 @@
/// Return the token representing the 'continue' keyword.
Token get continueKeyword;
- /// Set the token representing the 'continue' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set continueKeyword(Token token);
-
/// Return the label associated with the statement, or `null` if there is no
/// label.
SimpleIdentifier? get label;
- /// Set the label associated with the statement to the given [identifier].
- @Deprecated('Clients should not build AST manually')
- set label(SimpleIdentifier? identifier);
-
/// Return the semicolon terminating the statement.
Token get semicolon;
- /// Set the semicolon terminating the statement to the given [token].
- @Deprecated('Clients should not build AST manually')
- set semicolon(Token token);
-
/// Return the node to which this continue statement is continuing.
///
/// This will be either a [Statement] (in the case of continuing a loop), a
@@ -1834,11 +1353,6 @@
/// target might be invalid (e.g. the target may be in an enclosing
/// function).
AstNode? get target;
-
- /// Set the node to which this continue statement is continuing to the given
- /// [node].
- @Deprecated('Clients should not build AST manually')
- set target(AstNode? node);
}
/// A node that represents the declaration of one or more names.
@@ -1866,10 +1380,6 @@
/// Return the name of the variable being declared.
SimpleIdentifier get identifier;
- /// Set the name of the variable being declared to the given [identifier].
- @Deprecated('Clients should not build AST manually')
- set identifier(SimpleIdentifier identifier);
-
/// Return `true` if this variable was declared with the 'const' modifier.
bool get isConst;
@@ -1882,18 +1392,9 @@
/// keyword, or `null` if no keyword was used.
Token? get keyword;
- /// Set the token representing either the 'final', 'const' or 'var' keyword to
- /// the given [token].
- @Deprecated('Clients should not build AST manually')
- set keyword(Token? token);
-
/// Return the name of the declared type of the parameter, or `null` if the
/// parameter does not have a declared type.
TypeAnnotation? get type;
-
- /// Set the declared type of the parameter to the given [type].
- @Deprecated('Clients should not build AST manually')
- set type(TypeAnnotation? type);
}
/// A formal parameter with a default value.
@@ -1913,31 +1414,12 @@
/// `null` if there is no default value.
Expression? get defaultValue;
- /// Set the expression computing the default value for the parameter to the
- /// given [expression].
- @Deprecated('Clients should not build AST manually')
- set defaultValue(Expression? expression);
-
- /// Set the kind of this parameter to the given [kind].
- @Deprecated('Clients should not build AST manually')
- set kind(ParameterKind kind);
-
/// Return the formal parameter with which the default value is associated.
NormalFormalParameter get parameter;
- /// Set the formal parameter with which the default value is associated to the
- /// given [formalParameter].
- @Deprecated('Clients should not build AST manually')
- set parameter(NormalFormalParameter formalParameter);
-
/// Return the token separating the parameter from the default value, or
/// `null` if there is no default value.
Token? get separator;
-
- /// Set the token separating the parameter from the default value to the given
- /// [token].
- @Deprecated('Clients should not build AST manually')
- set separator(Token? token);
}
/// A node that represents a directive.
@@ -1956,10 +1438,6 @@
/// resolved.
Element? get element;
- /// Set the element associated with this directive to the given [element].
- @Deprecated('Clients should not build AST manually')
- set element(Element? element);
-
/// Return the token representing the keyword that introduces this directive
/// ('import', 'export', 'library' or 'part').
Token get keyword;
@@ -1975,52 +1453,23 @@
/// Return the body of the loop.
Statement get body;
- /// Set the body of the loop to the given [statement].
- @Deprecated('Clients should not build AST manually')
- set body(Statement statement);
-
/// Return the condition that determines when the loop will terminate.
Expression get condition;
- /// Set the condition that determines when the loop will terminate to the
- /// given [expression].
- @Deprecated('Clients should not build AST manually')
- set condition(Expression expression);
-
/// Return the token representing the 'do' keyword.
Token get doKeyword;
- /// Set the token representing the 'do' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set doKeyword(Token token);
-
/// Return the left parenthesis.
Token get leftParenthesis;
- /// Set the left parenthesis to the given [token].
- @Deprecated('Clients should not build AST manually')
- set leftParenthesis(Token token);
-
/// Return the right parenthesis.
Token get rightParenthesis;
- /// Set the right parenthesis to the given [token].
- @Deprecated('Clients should not build AST manually')
- set rightParenthesis(Token token);
-
/// Return the semicolon terminating the statement.
Token get semicolon;
- /// Set the semicolon terminating the statement to the given [token].
- @Deprecated('Clients should not build AST manually')
- set semicolon(Token token);
-
/// Return the token representing the 'while' keyword.
Token get whileKeyword;
-
- /// Set the token representing the 'while' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set whileKeyword(Token token);
}
/// A dotted name, used in a configuration within an import or export directive.
@@ -2048,16 +1497,8 @@
/// Return the token representing the literal.
Token get literal;
- /// Set the token representing the literal to the given [token].
- @Deprecated('Clients should not build AST manually')
- set literal(Token token);
-
/// Return the value of the literal.
double get value;
-
- /// Set the value of the literal to the given [value].
- @Deprecated('Clients should not build AST manually')
- set value(double value);
}
/// An empty function body, which can only appear in constructors or abstract
@@ -2071,11 +1512,6 @@
/// Return the token representing the semicolon that marks the end of the
/// function body.
Token get semicolon;
-
- /// Set the token representing the semicolon that marks the end of the
- /// function body to the given [token].
- @Deprecated('Clients should not build AST manually')
- set semicolon(Token token);
}
/// An empty statement.
@@ -2087,10 +1523,6 @@
abstract class EmptyStatement implements Statement {
/// Return the semicolon terminating the statement.
Token get semicolon;
-
- /// Set the semicolon terminating the statement to the given [token].
- @Deprecated('Clients should not build AST manually')
- set semicolon(Token token);
}
/// The declaration of an enum constant.
@@ -2099,10 +1531,6 @@
abstract class EnumConstantDeclaration implements Declaration {
/// Return the name of the constant.
SimpleIdentifier get name;
-
- /// Set the name of the constant to the given [name].
- @Deprecated('Clients should not build AST manually')
- set name(SimpleIdentifier name);
}
/// The declaration of an enumeration.
@@ -2121,26 +1549,14 @@
/// Return the 'enum' keyword.
Token get enumKeyword;
- /// Set the 'enum' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set enumKeyword(Token token);
-
/// Return the left curly bracket.
Token get leftBracket;
- /// Set the left curly bracket to the given [token].
- @Deprecated('Clients should not build AST manually')
- set leftBracket(Token token);
-
@override
SimpleIdentifier get name;
/// Return the right curly bracket.
Token get rightBracket;
-
- /// Set the right curly bracket to the given [token].
- @Deprecated('Clients should not build AST manually')
- set rightBracket(Token token);
}
/// An export directive.
@@ -2209,10 +1625,6 @@
/// has not been resolved.
DartType? get staticType;
- /// Set the static type of this expression to the given [type].
- @Deprecated('Clients should not build AST manually')
- set staticType(DartType? type);
-
/// If this expression is a parenthesized expression, return the result of
/// unwrapping the expression inside the parentheses. Otherwise, return this
/// expression.
@@ -2229,30 +1641,12 @@
/// Return the expression representing the body of the function.
Expression get expression;
- /// Set the expression representing the body of the function to the given
- /// [expression].
- @Deprecated('Clients should not build AST manually')
- set expression(Expression expression);
-
/// Return the token introducing the expression that represents the body of the
/// function.
Token get functionDefinition;
- /// Set the token introducing the expression that represents the body of the
- /// function to the given [token].
- @Deprecated('Clients should not build AST manually')
- set functionDefinition(Token token);
-
- /// Set token representing the 'async' or 'sync' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set keyword(Token? token);
-
/// Return the semicolon terminating the statement.
Token? get semicolon;
-
- /// Set the semicolon terminating the statement to the given [token].
- @Deprecated('Clients should not build AST manually')
- set semicolon(Token? token);
}
/// An expression used as a statement.
@@ -2265,18 +1659,10 @@
/// Return the expression that comprises the statement.
Expression get expression;
- /// Set the expression that comprises the statement to the given [expression].
- @Deprecated('Clients should not build AST manually')
- set expression(Expression expression);
-
/// Return the semicolon terminating the statement, or `null` if the
/// expression is a function expression and therefore isn't followed by a
/// semicolon.
Token? get semicolon;
-
- /// Set the semicolon terminating the statement to the given [token].
- @Deprecated('Clients should not build AST manually')
- set semicolon(Token? token);
}
/// The "extends" clause in a class declaration.
@@ -2289,16 +1675,8 @@
/// Return the token representing the 'extends' keyword.
Token get extendsKeyword;
- /// Set the token representing the 'extends' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set extendsKeyword(Token token);
-
/// Return the name of the class that is being extended.
TypeName get superclass;
-
- /// Set the name of the class that is being extended to the given [name].
- @Deprecated('Clients should not build AST manually')
- set superclass(TypeName name);
}
/// The declaration of an extension of a type.
@@ -2416,37 +1794,21 @@
/// The 'covariant' keyword, or `null` if the keyword was not used.
Token? get covariantKeyword;
- /// Set the token for the 'covariant' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set covariantKeyword(Token? token);
-
/// The `external` keyword, or `null` if the keyword was not used.
Token? get externalKeyword;
/// Return the fields being declared.
VariableDeclarationList get fields;
- /// Set the fields being declared to the given list of [fields].
- @Deprecated('Clients should not build AST manually')
- set fields(VariableDeclarationList fields);
-
/// Return `true` if the fields are declared to be static.
bool get isStatic;
/// Return the semicolon terminating the declaration.
Token get semicolon;
- /// Set the semicolon terminating the declaration to the given [token].
- @Deprecated('Clients should not build AST manually')
- set semicolon(Token token);
-
/// Return the token representing the 'static' keyword, or `null` if the
/// fields are not static.
Token? get staticKeyword;
-
- /// Set the token representing the 'static' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set staticKeyword(Token? token);
}
/// A field formal parameter.
@@ -2464,27 +1826,13 @@
/// keyword, or `null` if no keyword was used.
Token? get keyword;
- /// Set the token representing either the 'final', 'const' or 'var' keyword to
- /// the given [token].
- @Deprecated('Clients should not build AST manually')
- set keyword(Token? token);
-
/// Return the parameters of the function-typed parameter, or `null` if this
/// is not a function-typed field formal parameter.
FormalParameterList? get parameters;
- /// Set the parameters of the function-typed parameter to the given
- /// [parameters].
- @Deprecated('Clients should not build AST manually')
- set parameters(FormalParameterList? parameters);
-
/// Return the token representing the period.
Token get period;
- /// Set the token representing the period to the given [token].
- @Deprecated('Clients should not build AST manually')
- set period(Token token);
-
/// If the parameter is function-typed, and has the question mark, then its
/// function type is nullable. Having a nullable function type means that the
/// parameter can be null.
@@ -2493,10 +1841,6 @@
/// Return the token representing the 'this' keyword.
Token get thisKeyword;
- /// Set the token representing the 'this' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set thisKeyword(Token token);
-
/// Return the declared type of the parameter, or `null` if the parameter does
/// not have a declared type.
///
@@ -2504,18 +1848,9 @@
/// return type of the function.
TypeAnnotation? get type;
- /// Set the declared type of the parameter to the given [type].
- @Deprecated('Clients should not build AST manually')
- set type(TypeAnnotation? type);
-
/// Return the type parameters associated with this method, or `null` if this
/// method is not a generic method.
TypeParameterList? get typeParameters;
-
- /// Set the type parameters associated with this method to the given
- /// [typeParameters].
- @Deprecated('Clients should not build AST manually')
- set typeParameters(TypeParameterList? typeParameters);
}
/// The parts of a for-each loop that control the iteration.
@@ -2700,18 +2035,9 @@
/// the optional parameters, or `null` if there are no optional parameters.
Token? get leftDelimiter;
- /// Set the left square bracket ('[') or left curly brace ('{') introducing
- /// the optional parameters to the given [token].
- @Deprecated('Clients should not build AST manually')
- set leftDelimiter(Token? token);
-
/// Return the left parenthesis.
Token get leftParenthesis;
- /// Set the left parenthesis to the given [token].
- @Deprecated('Clients should not build AST manually')
- set leftParenthesis(Token token);
-
/// Return a list containing the elements representing the parameters in this
/// list.
///
@@ -2727,17 +2053,8 @@
/// parameters.
Token? get rightDelimiter;
- /// Set the right square bracket (']') or right curly brace ('}') terminating
- /// the optional parameters to the given [token].
- @Deprecated('Clients should not build AST manually')
- set rightDelimiter(Token? token);
-
/// Return the right parenthesis.
Token get rightParenthesis;
-
- /// Set the right parenthesis to the given [token].
- @Deprecated('Clients should not build AST manually')
- set rightParenthesis(Token token);
}
/// The parts of a for loop that control the iteration.
@@ -2892,18 +2209,9 @@
/// not an external function.
Token? get externalKeyword;
- /// Set the token representing the 'external' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set externalKeyword(Token? token);
-
/// Return the function expression being wrapped.
FunctionExpression get functionExpression;
- /// Set the function expression being wrapped to the given
- /// [functionExpression].
- @Deprecated('Clients should not build AST manually')
- set functionExpression(FunctionExpression functionExpression);
-
/// Return `true` if this function declares a getter.
bool get isGetter;
@@ -2917,18 +2225,9 @@
/// this is a function declaration rather than a property declaration.
Token? get propertyKeyword;
- /// Set the token representing the 'get' or 'set' keyword to the given
- /// [token].
- @Deprecated('Clients should not build AST manually')
- set propertyKeyword(Token? token);
-
/// Return the return type of the function, or `null` if no return type was
/// declared.
TypeAnnotation? get returnType;
-
- /// Set the return type of the function to the given [type].
- @Deprecated('Clients should not build AST manually')
- set returnType(TypeAnnotation? type);
}
/// A [FunctionDeclaration] used as a statement.
@@ -2937,11 +2236,6 @@
abstract class FunctionDeclarationStatement implements Statement {
/// Return the function declaration being wrapped.
FunctionDeclaration get functionDeclaration;
-
- /// Set the function declaration being wrapped to the given
- /// [functionDeclaration].
- @Deprecated('Clients should not build AST manually')
- set functionDeclaration(FunctionDeclaration functionDeclaration);
}
/// A function expression.
@@ -2954,10 +2248,6 @@
/// Return the body of the function.
FunctionBody get body;
- /// Set the body of the function to the given [functionBody].
- @Deprecated('Clients should not build AST manually')
- set body(FunctionBody functionBody);
-
/// Return the element associated with the function, or `null` if the AST
/// structure has not been resolved.
ExecutableElement? get declaredElement;
@@ -2966,19 +2256,9 @@
/// function is part of a top-level getter.
FormalParameterList? get parameters;
- /// Set the parameters associated with the function to the given list of
- /// [parameters].
- @Deprecated('Clients should not build AST manually')
- set parameters(FormalParameterList? parameters);
-
/// Return the type parameters associated with this method, or `null` if this
/// method is not a generic method.
TypeParameterList? get typeParameters;
-
- /// Set the type parameters associated with this method to the given
- /// [typeParameters].
- @Deprecated('Clients should not build AST manually')
- set typeParameters(TypeParameterList? typeParameters);
}
/// The invocation of a function resulting from evaluating an expression.
@@ -2993,33 +2273,14 @@
/// Clients may not extend, implement or mix-in this class.
abstract class FunctionExpressionInvocation
implements NullShortableExpression, InvocationExpression {
- /// Set the list of arguments to the method to the given [argumentList].
- @Deprecated('Clients should not build AST manually')
- set argumentList(ArgumentList argumentList);
-
/// Return the expression producing the function being invoked.
@override
Expression get function;
- /// Set the expression producing the function being invoked to the given
- /// [expression].
- @Deprecated('Clients should not build AST manually')
- set function(Expression expression);
-
/// Return the element associated with the function being invoked based on
/// static type information, or `null` if the AST structure has not been
/// resolved or the function could not be resolved.
ExecutableElement? get staticElement;
-
- /// Set the element associated with the function being invoked based on static
- /// type information to the given [element].
- @Deprecated('Clients should not build AST manually')
- set staticElement(ExecutableElement? element);
-
- /// Set the type arguments to be applied to the method being invoked to the
- /// given [typeArguments].
- @Deprecated('Clients should not build AST manually')
- set typeArguments(TypeArgumentList? typeArguments);
}
/// An expression representing a reference to a function, possibly with type
@@ -3063,34 +2324,18 @@
/// Clients may not extend, implement or mix-in this class.
abstract class FunctionTypeAlias implements TypeAlias {
@override
- // ignore: deprecated_member_use_from_same_package
- FunctionTypeAliasElement? get declaredElement;
+ TypeAliasElement? get declaredElement;
/// Return the parameters associated with the function type.
FormalParameterList get parameters;
- /// Set the parameters associated with the function type to the given list of
- /// [parameters].
- @Deprecated('Clients should not build AST manually')
- set parameters(FormalParameterList parameters);
-
/// Return the return type of the function type being defined, or `null` if no
/// return type was given.
TypeAnnotation? get returnType;
- /// Set the return type of the function type being defined to the given
- /// [type].
- @Deprecated('Clients should not build AST manually')
- set returnType(TypeAnnotation? type);
-
/// Return the type parameters for the function type, or `null` if the
/// function type does not have any type parameters.
TypeParameterList? get typeParameters;
-
- /// Set the type parameters for the function type to the given list of
- /// [typeParameters].
- @Deprecated('Clients should not build AST manually')
- set typeParameters(TypeParameterList? typeParameters);
}
/// A function-typed formal parameter.
@@ -3107,11 +2352,6 @@
/// Return the parameters of the function-typed parameter.
FormalParameterList get parameters;
- /// Set the parameters of the function-typed parameter to the given
- /// [parameters].
- @Deprecated('Clients should not build AST manually')
- set parameters(FormalParameterList parameters);
-
/// Return the question mark indicating that the function type is nullable, or
/// `null` if there is no question mark. Having a nullable function type means
/// that the parameter can be null.
@@ -3121,18 +2361,9 @@
/// have a return type.
TypeAnnotation? get returnType;
- /// Set the return type of the function to the given [type].
- @Deprecated('Clients should not build AST manually')
- set returnType(TypeAnnotation? type);
-
/// Return the type parameters associated with this function, or `null` if
/// this function is not a generic function.
TypeParameterList? get typeParameters;
-
- /// Set the type parameters associated with this method to the given
- /// [typeParameters].
- @Deprecated('Clients should not build AST manually')
- set typeParameters(TypeParameterList? typeParameters);
}
/// An anonymous function type.
@@ -3169,39 +2400,16 @@
/// Return the keyword 'Function'.
Token get functionKeyword;
- /// Set the keyword 'Function' to the given [token].
- @Deprecated('Clients should not build AST manually')
- set functionKeyword(Token token);
-
/// Return the parameters associated with the function type.
FormalParameterList get parameters;
- /// Set the parameters associated with the function type to the given list of
- /// [parameters].
- @Deprecated('Clients should not build AST manually')
- set parameters(FormalParameterList parameters);
-
- /// Set the question mark indicating that the type is nullable to the given
- /// [token].
- @Deprecated('Clients should not build AST manually')
- set question(Token? token);
-
/// Return the return type of the function type being defined, or `null` if
/// no return type was given.
TypeAnnotation? get returnType;
- /// Set the return type of the function type being defined to the given[type].
- @Deprecated('Clients should not build AST manually')
- set returnType(TypeAnnotation? type);
-
/// Return the type parameters for the function type, or `null` if the
/// function type does not have any type parameters.
TypeParameterList? get typeParameters;
-
- /// Set the type parameters for the function type to the given list of
- /// [typeParameters].
- @Deprecated('Clients should not build AST manually')
- set typeParameters(TypeParameterList? typeParameters);
}
/// A generic type alias.
@@ -3215,33 +2423,18 @@
/// type.
Token get equals;
- /// Set the equal sign separating the name being defined from the function
- /// type to the given [token].
- @Deprecated('Clients should not build AST manually')
- set equals(Token token);
-
/// Return the type of function being defined by the alias.
///
/// When the non-function type aliases feature is enabled and the denoted
/// type is not a [GenericFunctionType], return `null`.
GenericFunctionType? get functionType;
- /// Set the type of function being defined by the alias to the given
- /// [functionType].
- @Deprecated('Clients should not build AST manually')
- set functionType(GenericFunctionType? functionType);
-
/// Return the type being defined by the alias.
TypeAnnotation get type;
/// Return the type parameters for the function type, or `null` if the
/// function type does not have any type parameters.
TypeParameterList? get typeParameters;
-
- /// Set the type parameters for the function type to the given list of
- /// [typeParameters].
- @Deprecated('Clients should not build AST manually')
- set typeParameters(TypeParameterList? typeParameters);
}
/// A combinator that restricts the names being imported to those that are not
@@ -3322,57 +2515,26 @@
/// next.
Expression get condition;
- /// Set the condition used to determine which of the statements is executed
- /// next to the given [expression].
- @Deprecated('Clients should not build AST manually')
- set condition(Expression expression);
-
/// Return the token representing the 'else' keyword, or `null` if there is no
/// else statement.
Token? get elseKeyword;
- /// Set the token representing the 'else' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set elseKeyword(Token? token);
-
/// Return the statement that is executed if the condition evaluates to
/// `false`, or `null` if there is no else statement.
Statement? get elseStatement;
- /// Set the statement that is executed if the condition evaluates to `false`
- /// to the given [statement].
- @Deprecated('Clients should not build AST manually')
- set elseStatement(Statement? statement);
-
/// Return the token representing the 'if' keyword.
Token get ifKeyword;
- /// Set the token representing the 'if' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set ifKeyword(Token token);
-
/// Return the left parenthesis.
Token get leftParenthesis;
- /// Set the left parenthesis to the given [token].
- @Deprecated('Clients should not build AST manually')
- set leftParenthesis(Token token);
-
/// Return the right parenthesis.
Token get rightParenthesis;
- /// Set the right parenthesis to the given [token].
- @Deprecated('Clients should not build AST manually')
- set rightParenthesis(Token token);
-
/// Return the statement that is executed if the condition evaluates to
/// `true`.
Statement get thenStatement;
-
- /// Set the statement that is executed if the condition evaluates to `true` to
- /// the given [statement].
- @Deprecated('Clients should not build AST manually')
- set thenStatement(Statement statement);
}
/// The "implements" clause in an class declaration.
@@ -3385,10 +2547,6 @@
/// Return the token representing the 'implements' keyword.
Token get implementsKeyword;
- /// Set the token representing the 'implements' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set implementsKeyword(Token token);
-
/// Return the list of the interfaces that are being implemented.
NodeList<TypeName> get interfaces;
}
@@ -3511,29 +2669,16 @@
/// names are not prefixed.
Token? get asKeyword;
- /// Set the token representing the 'as' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set asKeyword(Token? token);
-
/// Return the token representing the 'deferred' keyword, or `null` if the
/// imported URI is not deferred.
Token? get deferredKeyword;
- /// Set the token representing the 'deferred' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set deferredKeyword(Token? token);
-
@override
ImportElement? get element;
/// Return the prefix to be used with the imported names, or `null` if the
/// imported names are not prefixed.
SimpleIdentifier? get prefix;
-
- /// Set the prefix to be used with the imported names to the given
- /// [identifier].
- @Deprecated('Clients should not build AST manually')
- set prefix(SimpleIdentifier? identifier);
}
/// An index expression.
@@ -3547,10 +2692,6 @@
/// Return the expression used to compute the index.
Expression get index;
- /// Set the expression used to compute the index to the given [expression].
- @Deprecated('Clients should not build AST manually')
- set index(Expression expression);
-
/// Return `true` if this expression is cascaded.
///
/// If it is, then the target of this expression is not stored locally but is
@@ -3563,19 +2704,10 @@
/// Return the left square bracket.
Token get leftBracket;
- /// Set the left square bracket to the given [token].
- @Deprecated('Clients should not build AST manually')
- set leftBracket(Token token);
-
/// Return the period (".." | "?..") before a cascaded index expression, or
/// `null` if this index expression is not part of a cascade expression.
Token? get period;
- /// Set the period ("..") before a cascaded index expression to the given
- /// [token].
- @Deprecated('Clients should not build AST manually')
- set period(Token? token);
-
/// Return the question mark before the left bracket, or `null` if there is no
/// question mark.
Token? get question;
@@ -3598,11 +2730,6 @@
/// a cascade expression.
Expression? get target;
- /// Set the expression used to compute the object being indexed to the given
- /// [expression].
- @Deprecated('Clients should not build AST manually')
- set target(Expression? expression);
-
/// Return `true` if this expression is computing a right-hand value (that is,
/// if this expression is in a context where the operator '[]' will be
/// invoked).
@@ -3634,17 +2761,9 @@
/// Return the list of arguments to the constructor.
ArgumentList get argumentList;
- /// Set the list of arguments to the constructor to the given [argumentList].
- @Deprecated('Clients should not build AST manually')
- set argumentList(ArgumentList argumentList);
-
/// Return the name of the constructor to be invoked.
ConstructorName get constructorName;
- /// Set the name of the constructor to be invoked to the given [name].
- @Deprecated('Clients should not build AST manually')
- set constructorName(ConstructorName name);
-
/// Return `true` if this creation expression is used to invoke a constant
/// constructor, either because the keyword `const` was explicitly provided or
/// because no keyword was provided and this expression is in a constant
@@ -3654,11 +2773,6 @@
/// Return the 'new' or 'const' keyword used to indicate how an object should
/// be created, or `null` if the keyword was not explicitly provided.
Token? get keyword;
-
- /// Set the 'new' or 'const' keyword used to indicate how an object should be
- /// created to the given [token].
- @Deprecated('Clients should not build AST manually')
- set keyword(Token? token);
}
/// An integer literal expression.
@@ -3679,17 +2793,9 @@
/// Return the token representing the literal.
Token get literal;
- /// Set the token representing the literal to the given [token].
- @Deprecated('Clients should not build AST manually')
- set literal(Token token);
-
/// Return the value of the literal, or `null` when [literal] does not
/// represent a valid `int` value, for example because of overflow.
int? get value;
-
- /// Set the value of the literal to the given [value].
- @Deprecated('Clients should not build AST manually')
- set value(int? value);
}
/// A node within a [StringInterpolation].
@@ -3713,29 +2819,14 @@
/// string.
Expression get expression;
- /// Set the expression to be evaluated for the value to be converted into a
- /// string to the given [expression].
- @Deprecated('Clients should not build AST manually')
- set expression(Expression expression);
-
/// Return the token used to introduce the interpolation expression; either
/// '$' if the expression is a simple identifier or '${' if the expression is
/// a full expression.
Token get leftBracket;
- /// Set the token used to introduce the interpolation expression; either '$'
- /// if the expression is a simple identifier or '${' if the expression is a
- /// full expression to the given [token].
- @Deprecated('Clients should not build AST manually')
- set leftBracket(Token token);
-
/// Return the right curly bracket, or `null` if the expression is an
/// identifier without brackets.
Token? get rightBracket;
-
- /// Set the right curly bracket to the given [token].
- @Deprecated('Clients should not build AST manually')
- set rightBracket(Token? token);
}
/// A non-empty substring of an interpolated string.
@@ -3748,10 +2839,6 @@
/// Return the characters that will be added to the string.
Token get contents;
- /// Set the characters that will be added to the string to the given [token].
- @Deprecated('Clients should not build AST manually')
- set contents(Token token);
-
/// Return the offset of the after-last contents character.
int get contentsEnd;
@@ -3760,10 +2847,6 @@
/// Return the value of the literal.
String get value;
-
- /// Set the value of the literal to the given [value].
- @Deprecated('Clients should not build AST manually')
- set value(String value);
}
/// The invocation of a function or method; either a
@@ -3793,11 +2876,6 @@
/// store the type of that `call` method here as parameterized.
DartType? get staticInvokeType;
- /// Sets the function type of the invocation based on the static type
- /// information.
- @Deprecated('Clients should not build AST manually')
- set staticInvokeType(DartType? value);
-
/// Return the type arguments to be applied to the method being invoked, or
/// `null` if no type arguments were provided.
TypeArgumentList? get typeArguments;
@@ -3823,32 +2901,15 @@
/// tested.
Expression get expression;
- /// Set the expression used to compute the value whose type is being tested to
- /// the given [expression].
- @Deprecated('Clients should not build AST manually')
- set expression(Expression expression);
-
/// Return the is operator.
Token get isOperator;
- /// Set the is operator to the given [token].
- @Deprecated('Clients should not build AST manually')
- set isOperator(Token token);
-
/// Return the not operator, or `null` if the sense of the test is not
/// negated.
Token? get notOperator;
- /// Set the not operator to the given [token].
- @Deprecated('Clients should not build AST manually')
- set notOperator(Token? token);
-
/// Return the type being tested for.
TypeAnnotation get type;
-
- /// Set the type being tested for to the given [type].
- @Deprecated('Clients should not build AST manually')
- set type(TypeAnnotation type);
}
/// A label on either a [LabeledStatement] or a [NamedExpression].
@@ -3861,17 +2922,8 @@
/// Return the colon that separates the label from the statement.
Token get colon;
- /// Set the colon that separates the label from the statement to the given
- /// [token].
- @Deprecated('Clients should not build AST manually')
- set colon(Token token);
-
/// Return the label being associated with the statement.
SimpleIdentifier get label;
-
- /// Set the label being associated with the statement to the given [label].
- @Deprecated('Clients should not build AST manually')
- set label(SimpleIdentifier label);
}
/// A statement that has a label associated with them.
@@ -3886,11 +2938,6 @@
/// Return the statement with which the labels are being associated.
Statement get statement;
-
- /// Set the statement with which the labels are being associated to the given
- /// [statement].
- @Deprecated('Clients should not build AST manually')
- set statement(Statement statement);
}
/// A library directive.
@@ -3903,23 +2950,11 @@
/// Return the token representing the 'library' keyword.
Token get libraryKeyword;
- /// Set the token representing the 'library' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set libraryKeyword(Token token);
-
/// Return the name of the library being defined.
LibraryIdentifier get name;
- /// Set the name of the library being defined to the given [name].
- @Deprecated('Clients should not build AST manually')
- set name(LibraryIdentifier name);
-
/// Return the semicolon terminating the directive.
Token get semicolon;
-
- /// Set the semicolon terminating the directive to the given [token].
- @Deprecated('Clients should not build AST manually')
- set semicolon(Token token);
}
/// The identifier for a library.
@@ -3949,16 +2984,8 @@
/// Return the left square bracket.
Token get leftBracket;
- /// Set the left square bracket to the given [token].
- @Deprecated('Clients should not build AST manually')
- set leftBracket(Token token);
-
/// Return the right square bracket.
Token get rightBracket;
-
- /// Set the right square bracket to the given [token].
- @Deprecated('Clients should not build AST manually')
- set rightBracket(Token token);
}
/// A node that represents a literal expression.
@@ -3986,26 +3013,12 @@
/// associated.
Expression get key;
- /// Set the expression computing the key with which the value will be
- /// associated to the given [string].
- @Deprecated('Clients should not build AST manually')
- set key(Expression string);
-
/// Return the colon that separates the key from the value.
Token get separator;
- /// Set the colon that separates the key from the value to the given [token].
- @Deprecated('Clients should not build AST manually')
- set separator(Token token);
-
/// Return the expression computing the value that will be associated with the
/// key.
Expression get value;
-
- /// Set the expression computing the value that will be associated with the
- /// key to the given [expression].
- @Deprecated('Clients should not build AST manually')
- set value(Expression expression);
}
/// A method declaration.
@@ -4030,10 +3043,6 @@
/// Return the body of the method.
FunctionBody get body;
- /// Set the body of the method to the given [functionBody].
- @Deprecated('Clients should not build AST manually')
- set body(FunctionBody functionBody);
-
@override
ExecutableElement? get declaredElement;
@@ -4041,10 +3050,6 @@
/// is not external.
Token? get externalKeyword;
- /// Set the token for the 'external' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set externalKeyword(Token? token);
-
/// Return `true` if this method is declared to be an abstract method.
bool get isAbstract;
@@ -4064,60 +3069,28 @@
/// `null` if neither modifier was specified.
Token? get modifierKeyword;
- /// Set the token representing the 'abstract' or 'static' keyword to the given
- /// [token].
- @Deprecated('Clients should not build AST manually')
- set modifierKeyword(Token? token);
-
/// Return the name of the method.
SimpleIdentifier get name;
- /// Set the name of the method to the given [identifier].
- @Deprecated('Clients should not build AST manually')
- set name(SimpleIdentifier identifier);
-
/// Return the token representing the 'operator' keyword, or `null` if this
/// method does not declare an operator.
Token? get operatorKeyword;
- /// Set the token representing the 'operator' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set operatorKeyword(Token? token);
-
/// Return the parameters associated with the method, or `null` if this method
/// declares a getter.
FormalParameterList? get parameters;
- /// Set the parameters associated with the method to the given list of
- /// [parameters].
- @Deprecated('Clients should not build AST manually')
- set parameters(FormalParameterList? parameters);
-
/// Return the token representing the 'get' or 'set' keyword, or `null` if
/// this is a method declaration rather than a property declaration.
Token? get propertyKeyword;
- /// Set the token representing the 'get' or 'set' keyword to the given
- /// [token].
- @Deprecated('Clients should not build AST manually')
- set propertyKeyword(Token? token);
-
/// Return the return type of the method, or `null` if no return type was
/// declared.
TypeAnnotation? get returnType;
- /// Set the return type of the method to the given [type].
- @Deprecated('Clients should not build AST manually')
- set returnType(TypeAnnotation? type);
-
/// Return the type parameters associated with this method, or `null` if this
/// method is not a generic method.
TypeParameterList? get typeParameters;
-
- /// Set the type parameters associated with this method to the given
- /// [typeParameters].
- @Deprecated('Clients should not build AST manually')
- set typeParameters(TypeParameterList? typeParameters);
}
/// The invocation of either a function or a method.
@@ -4133,10 +3106,6 @@
/// Clients may not extend, implement or mix-in this class.
abstract class MethodInvocation
implements NullShortableExpression, InvocationExpression {
- /// Set the list of arguments to the method to the given [argumentList].
- @Deprecated('Clients should not build AST manually')
- set argumentList(ArgumentList argumentList);
-
/// Return `true` if this expression is cascaded.
///
/// If it is, then the target of this expression is not stored locally but is
@@ -4149,10 +3118,6 @@
/// Return the name of the method being invoked.
SimpleIdentifier get methodName;
- /// Set the name of the method being invoked to the given [identifier].
- @Deprecated('Clients should not build AST manually')
- set methodName(SimpleIdentifier identifier);
-
/// Return the operator that separates the target from the method name, or
/// `null` if there is no target.
///
@@ -4160,11 +3125,6 @@
/// section this will be the cascade operator ('..').
Token? get operator;
- /// Set the operator that separates the target from the method name to the
- /// given [token].
- @Deprecated('Clients should not build AST manually')
- set operator(Token? token);
-
/// Return the expression used to compute the receiver of the invocation.
///
/// If this invocation is not part of a cascade expression, then this is the
@@ -4179,16 +3139,6 @@
/// Use [realTarget] to get the target independent of whether this is part of
/// a cascade expression.
Expression? get target;
-
- /// Set the expression producing the object on which the method is defined to
- /// the given [expression].
- @Deprecated('Clients should not build AST manually')
- set target(Expression? expression);
-
- /// Set the type arguments to be applied to the method being invoked to the
- /// given [typeArguments].
- @Deprecated('Clients should not build AST manually')
- set typeArguments(TypeArgumentList? typeArguments);
}
/// An expression that implicitly makes reference to a method.
@@ -4201,11 +3151,6 @@
/// non-compound assignment expression, or because the method referred to
/// could not be resolved).
MethodElement? get staticElement;
-
- /// Set the element associated with the expression based on static types to
- /// the given [element].
- @Deprecated('Clients should not build AST manually')
- set staticElement(MethodElement? element);
}
/// The declaration of a mixin.
@@ -4230,10 +3175,6 @@
abstract class NamedCompilationUnitMember implements CompilationUnitMember {
/// Return the name of the member being declared.
SimpleIdentifier get name;
-
- /// Set the name of the member being declared to the given [identifier].
- @Deprecated('Clients should not build AST manually')
- set name(SimpleIdentifier identifier);
}
/// An expression that has a name associated with it. They are used in method
@@ -4252,17 +3193,8 @@
/// Return the expression with which the name is associated.
Expression get expression;
- /// Set the expression with which the name is associated to the given
- /// [expression].
- @Deprecated('Clients should not build AST manually')
- set expression(Expression expression);
-
/// Return the name associated with the expression.
Label get name;
-
- /// Set the name associated with the expression to the given [identifier].
- @Deprecated('Clients should not build AST manually')
- set name(Label identifier);
}
/// A named type, which can optionally include type arguments.
@@ -4281,27 +3213,9 @@
/// Return the name of the type.
Identifier get name;
- /// Set the name of the type to the given [identifier].
- @Deprecated('Clients should not build AST manually')
- set name(Identifier identifier);
-
- /// Set the question mark indicating that the type is nullable to the given
- /// [token].
- @Deprecated('Clients should not build AST manually')
- set question(Token? token);
-
- /// Set the type being named to the given [type].
- @Deprecated('Clients should not build AST manually')
- set type(DartType? type);
-
/// Return the type arguments associated with the type, or `null` if there are
/// no type arguments.
TypeArgumentList? get typeArguments;
-
- /// Set the type arguments associated with the type to the given
- /// [typeArguments].
- @Deprecated('Clients should not build AST manually')
- set typeArguments(TypeArgumentList? typeArguments);
}
/// A node that represents a directive that impacts the namespace of a library.
@@ -4319,11 +3233,6 @@
/// loaded at run-time.
NodeList<Configuration> get configurations;
- /// Set the token representing the keyword that introduces this directive
- /// ('import', 'export', 'library' or 'part') to the given [token].
- @Deprecated('Clients should not build AST manually')
- set keyword(Token token);
-
/// Return the source that was selected based on the declared variables.
///
/// This will be the source from the first configuration whose condition is
@@ -4342,10 +3251,6 @@
/// Return the semicolon terminating the directive.
Token get semicolon;
- /// Set the semicolon terminating the directive to the given [token].
- @Deprecated('Clients should not build AST manually')
- set semicolon(Token token);
-
@override
LibraryElement? get uriElement;
}
@@ -4360,17 +3265,8 @@
/// Return the name of the native object that implements the class.
StringLiteral? get name;
- /// Set the name of the native object that implements the class to the given
- /// [name].
- @Deprecated('Clients should not build AST manually')
- set name(StringLiteral? name);
-
/// Return the token representing the 'native' keyword.
Token get nativeKeyword;
-
- /// Set the token representing the 'native' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set nativeKeyword(Token token);
}
/// A function body that consists of a native keyword followed by a string
@@ -4385,28 +3281,13 @@
/// function body.
Token get nativeKeyword;
- /// Set the token representing 'native' that marks the start of the function
- /// body to the given [token].
- @Deprecated('Clients should not build AST manually')
- set nativeKeyword(Token token);
-
/// Return the token representing the semicolon that marks the end of the
/// function body.
Token get semicolon;
- /// Set the token representing the semicolon that marks the end of the
- /// function body to the given [token].
- @Deprecated('Clients should not build AST manually')
- set semicolon(Token token);
-
/// Return the string literal representing the string after the 'native'
/// token.
StringLiteral? get stringLiteral;
-
- /// Set the string literal representing the string after the 'native' token to
- /// the given [stringLiteral].
- @Deprecated('Clients should not build AST manually')
- set stringLiteral(StringLiteral? stringLiteral);
}
/// A list of AST nodes that have a common parent.
@@ -4429,12 +3310,6 @@
@override
E operator [](int index);
- /// Set the node at the given [index] in the list to the given [node] or throw
- /// a [RangeError] if [index] is out of bounds.
- @Deprecated('Clients should not build AST manually')
- @override
- void operator []=(int index, E node);
-
/// Use the given [visitor] to visit each of the nodes in this list.
void accept(AstVisitor visitor);
}
@@ -4448,28 +3323,11 @@
///
/// Clients may not extend, implement or mix-in this class.
abstract class NormalFormalParameter implements FormalParameter {
- /// Set the token for the 'covariant' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set covariantKeyword(Token? token);
-
/// Return the documentation comment associated with this parameter, or `null`
/// if this parameter does not have a documentation comment associated with
/// it.
Comment? get documentationComment;
- /// Set the documentation comment associated with this parameter to the given
- /// [comment].
- @Deprecated('Clients should not build AST manually')
- set documentationComment(Comment? comment);
-
- /// Set the name of the parameter being declared to the given [identifier].
- @Deprecated('Clients should not build AST manually')
- set identifier(SimpleIdentifier? identifier);
-
- /// Set the metadata associated with this node to the given [metadata].
- @Deprecated('Clients should not build AST manually')
- set metadata(List<Annotation> metadata);
-
/// Return a list containing the comment and annotations associated with this
/// parameter, sorted in lexical order.
List<AstNode> get sortedCommentAndAnnotations;
@@ -4484,10 +3342,6 @@
abstract class NullLiteral implements Literal {
/// Return the token representing the literal.
Token get literal;
-
- /// Set the token representing the literal to the given [token].
- @Deprecated('Clients should not build AST manually')
- set literal(Token token);
}
/// Abstract interface for expressions that may participate in null-shorting.
@@ -4532,23 +3386,11 @@
/// Return the expression within the parentheses.
Expression get expression;
- /// Set the expression within the parentheses to the given [expression].
- @Deprecated('Clients should not build AST manually')
- set expression(Expression expression);
-
/// Return the left parenthesis.
Token get leftParenthesis;
- /// Set the left parenthesis to the given [token].
- @Deprecated('Clients should not build AST manually')
- set leftParenthesis(Token token);
-
/// Return the right parenthesis.
Token get rightParenthesis;
-
- /// Set the right parenthesis to the given [token].
- @Deprecated('Clients should not build AST manually')
- set rightParenthesis(Token token);
}
/// A part directive.
@@ -4561,16 +3403,8 @@
/// Return the token representing the 'part' keyword.
Token get partKeyword;
- /// Set the token representing the 'part' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set partKeyword(Token token);
-
/// Return the semicolon terminating the directive.
Token get semicolon;
-
- /// Set the semicolon terminating the directive to the given [token].
- @Deprecated('Clients should not build AST manually')
- set semicolon(Token token);
}
/// A part-of directive.
@@ -4584,42 +3418,19 @@
/// part of.
LibraryIdentifier? get libraryName;
- /// Set the name of the library that the containing compilation unit is part
- /// of to the given [libraryName].
- @Deprecated('Clients should not build AST manually')
- set libraryName(LibraryIdentifier? libraryName);
-
/// Return the token representing the 'of' keyword.
Token get ofKeyword;
- /// Set the token representing the 'of' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set ofKeyword(Token token);
-
/// Return the token representing the 'part' keyword.
Token get partKeyword;
- /// Set the token representing the 'part' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set partKeyword(Token token);
-
/// Return the semicolon terminating the directive.
Token get semicolon;
- /// Set the semicolon terminating the directive to the given [token].
- @Deprecated('Clients should not build AST manually')
- set semicolon(Token token);
-
/// Return the URI of the library that the containing compilation unit is part
/// of, or `null` if no URI was given (typically because a library name was
/// provided).
StringLiteral? get uri;
-
- /// Return the URI of the library that the containing compilation unit is part
- /// of, or `null` if no URI was given (typically because a library name was
- /// provided).
- @Deprecated('Clients should not build AST manually')
- set uri(StringLiteral? uri);
}
/// A postfix unary expression.
@@ -4637,18 +3448,8 @@
/// Return the expression computing the operand for the operator.
Expression get operand;
- /// Set the expression computing the operand for the operator to the given
- /// [expression].
- @Deprecated('Clients should not build AST manually')
- set operand(Expression expression);
-
/// Return the postfix operator being applied to the operand.
Token get operator;
-
- /// Set the postfix operator being applied to the operand to the given
- /// [token].
- @Deprecated('Clients should not build AST manually')
- set operator(Token token);
}
/// An identifier that is prefixed or an access to an object property where the
@@ -4662,10 +3463,6 @@
/// Return the identifier being prefixed.
SimpleIdentifier get identifier;
- /// Set the identifier being prefixed to the given [identifier].
- @Deprecated('Clients should not build AST manually')
- set identifier(SimpleIdentifier identifier);
-
/// Return `true` if this type is a deferred type. If the AST structure has
/// not been resolved, then return `false`.
///
@@ -4676,19 +3473,9 @@
/// Return the period used to separate the prefix from the identifier.
Token get period;
- /// Set the period used to separate the prefix from the identifier to the
- /// given [token].
- @Deprecated('Clients should not build AST manually')
- set period(Token token);
-
/// Return the prefix associated with the library in which the identifier is
/// defined.
SimpleIdentifier get prefix;
-
- /// Set the prefix associated with the library in which the identifier is
- /// defined to the given [identifier].
- @Deprecated('Clients should not build AST manually')
- set prefix(SimpleIdentifier identifier);
}
/// A prefix unary expression.
@@ -4706,17 +3493,8 @@
/// Return the expression computing the operand for the operator.
Expression get operand;
- /// Set the expression computing the operand for the operator to the given
- /// [expression].
- @Deprecated('Clients should not build AST manually')
- set operand(Expression expression);
-
/// Return the prefix operator being applied to the operand.
Token get operator;
-
- /// Set the prefix operator being applied to the operand to the given [token].
- @Deprecated('Clients should not build AST manually')
- set operator(Token token);
}
/// The access of a property of an object.
@@ -4742,17 +3520,9 @@
/// Return the property access operator.
Token get operator;
- /// Set the property access operator to the given [token].
- @Deprecated('Clients should not build AST manually')
- set operator(Token token);
-
/// Return the name of the property being accessed.
SimpleIdentifier get propertyName;
- /// Set the name of the property being accessed to the given [identifier].
- @Deprecated('Clients should not build AST manually')
- set propertyName(SimpleIdentifier identifier);
-
/// Return the expression used to compute the receiver of the invocation.
///
/// If this invocation is not part of a cascade expression, then this is the
@@ -4767,11 +3537,6 @@
/// Use [realTarget] to get the target independent of whether this is part of
/// a cascade expression.
Expression? get target;
-
- /// Set the expression computing the object defining the property being
- /// accessed to the given [expression].
- @Deprecated('Clients should not build AST manually')
- set target(Expression? expression);
}
/// The invocation of a constructor in the same class from within a
@@ -4786,34 +3551,16 @@
/// Return the list of arguments to the constructor.
ArgumentList get argumentList;
- /// Set the list of arguments to the constructor to the given [argumentList].
- @Deprecated('Clients should not build AST manually')
- set argumentList(ArgumentList argumentList);
-
/// Return the name of the constructor that is being invoked, or `null` if the
/// unnamed constructor is being invoked.
SimpleIdentifier? get constructorName;
- /// Set the name of the constructor that is being invoked to the given
- /// [identifier].
- @Deprecated('Clients should not build AST manually')
- set constructorName(SimpleIdentifier? identifier);
-
/// Return the token for the period before the name of the constructor that is
/// being invoked, or `null` if the unnamed constructor is being invoked.
Token? get period;
- /// Set the token for the period before the name of the constructor that is
- /// being invoked to the given [token].
- @Deprecated('Clients should not build AST manually')
- set period(Token? token);
-
/// Return the token for the 'this' keyword.
Token get thisKeyword;
-
- /// Set the token for the 'this' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set thisKeyword(Token token);
}
/// A rethrow expression.
@@ -4825,10 +3572,6 @@
abstract class RethrowExpression implements Expression {
/// Return the token representing the 'rethrow' keyword.
Token get rethrowKeyword;
-
- /// Set the token representing the 'rethrow' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set rethrowKeyword(Token token);
}
/// A return statement.
@@ -4842,24 +3585,11 @@
/// explicit value was provided.
Expression? get expression;
- /// Set the expression computing the value to be returned to the given
- /// [expression].
- @Deprecated('Clients should not build AST manually')
- set expression(Expression? expression);
-
/// Return the token representing the 'return' keyword.
Token get returnKeyword;
- /// Set the token representing the 'return' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set returnKeyword(Token token);
-
/// Return the semicolon terminating the statement.
Token get semicolon;
-
- /// Set the semicolon terminating the statement to the given [token].
- @Deprecated('Clients should not build AST manually')
- set semicolon(Token token);
}
/// A script tag that can optionally occur at the beginning of a compilation
@@ -4872,10 +3602,6 @@
abstract class ScriptTag implements AstNode {
/// Return the token representing this script tag.
Token get scriptTag;
-
- /// Set the token representing this script tag to the given [token].
- @Deprecated('Clients should not build AST manually')
- set scriptTag(Token token);
}
/// A set or map literal.
@@ -4964,18 +3690,9 @@
/// keyword, or `null` if no keyword was used.
Token? get keyword;
- /// Set the token representing either the 'final', 'const' or 'var' keyword to
- /// the given [token].
- @Deprecated('Clients should not build AST manually')
- set keyword(Token? token);
-
/// Return the declared type of the parameter, or `null` if the parameter does
/// not have a declared type.
TypeAnnotation? get type;
-
- /// Set the declared type of the parameter to the given [type].
- @Deprecated('Clients should not build AST manually')
- set type(TypeAnnotation? type);
}
/// A simple identifier.
@@ -4993,11 +3710,6 @@
/// identifier or a method invocation.
bool get isQualified;
- /// Set the element associated with this identifier based on static type
- /// information to the given [element].
- @Deprecated('Clients should not build AST manually')
- set staticElement(Element? element);
-
/// If the identifier is a tear-off, return the inferred type arguments
/// applied to the function type of the element to produce its `[staticType]`.
///
@@ -5013,10 +3725,6 @@
/// Return the token representing the identifier.
Token get token;
- /// Set the token representing the identifier to the given [token].
- @Deprecated('Clients should not build AST manually')
- set token(Token token);
-
/// Return `true` if this identifier is the name being declared in a
/// declaration.
// TODO(brianwilkerson) Convert this to a getter.
@@ -5065,16 +3773,8 @@
/// Return the token representing the literal.
Token get literal;
- /// Set the token representing the literal to the given [token].
- @Deprecated('Clients should not build AST manually')
- set literal(Token token);
-
/// Return the value of the literal.
String get value;
-
- /// Set the value of the literal to the given [string].
- @Deprecated('Clients should not build AST manually')
- set value(String string);
}
/// A single string literal expression.
@@ -5195,34 +3895,16 @@
/// Return the list of arguments to the constructor.
ArgumentList get argumentList;
- /// Set the list of arguments to the constructor to the given [argumentList].
- @Deprecated('Clients should not build AST manually')
- set argumentList(ArgumentList argumentList);
-
/// Return the name of the constructor that is being invoked, or `null` if the
/// unnamed constructor is being invoked.
SimpleIdentifier? get constructorName;
- /// Set the name of the constructor that is being invoked to the given
- /// [identifier].
- @Deprecated('Clients should not build AST manually')
- set constructorName(SimpleIdentifier? identifier);
-
/// Return the token for the period before the name of the constructor that is
/// being invoked, or `null` if the unnamed constructor is being invoked.
Token? get period;
- /// Set the token for the period before the name of the constructor that is
- /// being invoked to the given [token].
- @Deprecated('Clients should not build AST manually')
- set period(Token? token);
-
/// Return the token for the 'super' keyword.
Token get superKeyword;
-
- /// Set the token for the 'super' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set superKeyword(Token token);
}
/// A super expression.
@@ -5234,10 +3916,6 @@
abstract class SuperExpression implements Expression {
/// Return the token representing the 'super' keyword.
Token get superKeyword;
-
- /// Set the token representing the 'super' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set superKeyword(Token token);
}
/// A case in a switch statement.
@@ -5249,11 +3927,6 @@
abstract class SwitchCase implements SwitchMember {
/// Return the expression controlling whether the statements will be executed.
Expression get expression;
-
- /// Set the expression controlling whether the statements will be executed to
- /// the given [expression].
- @Deprecated('Clients should not build AST manually')
- set expression(Expression expression);
}
/// The default case in a switch statement.
@@ -5276,19 +3949,9 @@
/// statements.
Token get colon;
- /// Set the colon separating the keyword or the expression from the
- /// statements to the given [token].
- @Deprecated('Clients should not build AST manually')
- set colon(Token token);
-
/// Return the token representing the 'case' or 'default' keyword.
Token get keyword;
- /// Set the token representing the 'case' or 'default' keyword to the given
- /// [token].
- @Deprecated('Clients should not build AST manually')
- set keyword(Token token);
-
/// Return the labels associated with the switch member.
NodeList<Label> get labels;
@@ -5308,48 +3971,23 @@
/// be selected.
Expression get expression;
- /// Set the expression used to determine which of the switch members will be
- /// selected to the given [expression].
- @Deprecated('Clients should not build AST manually')
- set expression(Expression expression);
-
/// Return the left curly bracket.
Token get leftBracket;
- /// Set the left curly bracket to the given [token].
- @Deprecated('Clients should not build AST manually')
- set leftBracket(Token token);
-
/// Return the left parenthesis.
Token get leftParenthesis;
- /// Set the left parenthesis to the given [token].
- @Deprecated('Clients should not build AST manually')
- set leftParenthesis(Token token);
-
/// Return the switch members that can be selected by the expression.
NodeList<SwitchMember> get members;
/// Return the right curly bracket.
Token get rightBracket;
- /// Set the right curly bracket to the given [token].
- @Deprecated('Clients should not build AST manually')
- set rightBracket(Token token);
-
/// Return the right parenthesis.
Token get rightParenthesis;
- /// Set the right parenthesis to the given [token].
- @Deprecated('Clients should not build AST manually')
- set rightParenthesis(Token token);
-
/// Return the token representing the 'switch' keyword.
Token get switchKeyword;
-
- /// Set the token representing the 'switch' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set switchKeyword(Token token);
}
/// A symbol literal expression.
@@ -5364,10 +4002,6 @@
/// Return the token introducing the literal.
Token get poundSign;
-
- /// Set the token introducing the literal to the given [token].
- @Deprecated('Clients should not build AST manually')
- set poundSign(Token token);
}
/// A this expression.
@@ -5379,10 +4013,6 @@
abstract class ThisExpression implements Expression {
/// Return the token representing the 'this' keyword.
Token get thisKeyword;
-
- /// Set the token representing the 'this' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set thisKeyword(Token token);
}
/// A throw expression.
@@ -5395,17 +4025,8 @@
/// Return the expression computing the exception to be thrown.
Expression get expression;
- /// Set the expression computing the exception to be thrown to the given
- /// [expression].
- @Deprecated('Clients should not build AST manually')
- set expression(Expression expression);
-
/// Return the token representing the 'throw' keyword.
Token get throwKeyword;
-
- /// Set the token representing the 'throw' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set throwKeyword(Token token);
}
/// The declaration of one or more top-level variables of the same type.
@@ -5429,17 +4050,8 @@
/// Return the semicolon terminating the declaration.
Token get semicolon;
- /// Set the semicolon terminating the declaration to the given [token].
- @Deprecated('Clients should not build AST manually')
- set semicolon(Token token);
-
/// Return the top-level variables being declared.
VariableDeclarationList get variables;
-
- /// Set the top-level variables being declared to the given list of
- /// [variables].
- @Deprecated('Clients should not build AST manually')
- set variables(VariableDeclarationList variables);
}
/// A try statement.
@@ -5455,10 +4067,6 @@
/// Return the body of the statement.
Block get body;
- /// Set the body of the statement to the given [block].
- @Deprecated('Clients should not build AST manually')
- set body(Block block);
-
/// Return the catch clauses contained in the try statement.
NodeList<CatchClause> get catchClauses;
@@ -5466,24 +4074,12 @@
/// statement does not contain a finally clause.
Block? get finallyBlock;
- /// Set the finally block contained in the try statement to the given [block].
- @Deprecated('Clients should not build AST manually')
- set finallyBlock(Block? block);
-
/// Return the token representing the 'finally' keyword, or `null` if the
/// statement does not contain a finally clause.
Token? get finallyKeyword;
- /// Set the token representing the 'finally' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set finallyKeyword(Token? token);
-
/// Return the token representing the 'try' keyword.
Token get tryKeyword;
-
- /// Set the token representing the 'try' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set tryKeyword(Token token);
}
/// The declaration of a type alias.
@@ -5503,16 +4099,8 @@
/// Return the semicolon terminating the declaration.
Token get semicolon;
- /// Set the semicolon terminating the declaration to the given [token].
- @Deprecated('Clients should not build AST manually')
- set semicolon(Token token);
-
/// Return the token representing the 'typedef' keyword.
Token get typedefKeyword;
-
- /// Set the token representing the 'typedef' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set typedefKeyword(Token token);
}
/// A type annotation.
@@ -5545,16 +4133,8 @@
/// Return the left bracket.
Token get leftBracket;
- /// Set the left bracket to the given [token].
- @Deprecated('Clients should not build AST manually')
- set leftBracket(Token token);
-
/// Return the right bracket.
Token get rightBracket;
-
- /// Set the right bracket to the given [token].
- @Deprecated('Clients should not build AST manually')
- set rightBracket(Token token);
}
/// A literal that has a type associated with it.
@@ -5569,10 +4149,6 @@
/// literal is not a constant.
Token? get constKeyword;
- /// Set the token representing the 'const' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set constKeyword(Token? token);
-
/// Return `true` if this literal is a constant expression, either because the
/// keyword `const` was explicitly provided or because no keyword was provided
/// and this expression is in a constant context.
@@ -5581,11 +4157,6 @@
/// Return the type argument associated with this literal, or `null` if no
/// type arguments were declared.
TypeArgumentList? get typeArguments;
-
- /// Set the type argument associated with this literal to the given
- /// [typeArguments].
- @Deprecated('Clients should not build AST manually')
- set typeArguments(TypeArgumentList? typeArguments);
}
/// An expression representing a type, e.g. the expression `int` in
@@ -5624,10 +4195,6 @@
/// explicit upper bound.
TypeAnnotation? get bound;
- /// Set the upper bound for legal arguments to the given [type].
- @Deprecated('Clients should not build AST manually')
- set bound(TypeAnnotation? type);
-
@override
TypeParameterElement? get declaredElement;
@@ -5635,16 +4202,8 @@
/// no explicit upper bound.
Token? get extendsKeyword;
- /// Set the token representing the 'extends' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set extendsKeyword(Token? token);
-
/// Return the name of the type parameter.
SimpleIdentifier get name;
-
- /// Set the name of the type parameter to the given [identifier].
- @Deprecated('Clients should not build AST manually')
- set name(SimpleIdentifier identifier);
}
/// Type parameters within a declaration.
@@ -5676,18 +4235,10 @@
/// Return the URI referenced by this directive.
StringLiteral get uri;
- /// Set the URI referenced by this directive to the given [uri].
- @Deprecated('Clients should not build AST manually')
- set uri(StringLiteral uri);
-
/// Return the content of the [uri], or `null` if the AST structure has not
/// been resolved, or if the [uri] has a string interpolation.
String? get uriContent;
- /// Set the content of the [uri] to the given [content].
- @Deprecated('Clients should not build AST manually')
- set uriContent(String? content);
-
/// Return the element associated with the [uri] of this directive, or `null`
/// if the AST structure has not been resolved or if the URI could not be
/// resolved.
@@ -5698,10 +4249,6 @@
/// Return the source to which the [uri] was resolved.
Source? get uriSource;
-
- /// Set the source to which the [uri] was resolved to the given [source].
- @Deprecated('Clients should not build AST manually')
- set uriSource(Source? source);
}
/// An identifier that has an initial value associated with it.
@@ -5725,20 +4272,10 @@
/// or `null` if the initial value was not specified.
Token? get equals;
- /// Set the equal sign separating the variable name from the initial value to
- /// the given [token].
- @Deprecated('Clients should not build AST manually')
- set equals(Token? token);
-
/// Return the expression used to compute the initial value for the variable,
/// or `null` if the initial value was not specified.
Expression? get initializer;
- /// Set the expression used to compute the initial value for the variable to
- /// the given [expression].
- @Deprecated('Clients should not build AST manually')
- set initializer(Expression? expression);
-
/// Return `true` if this variable was declared with the 'const' modifier.
bool get isConst;
@@ -5753,10 +4290,6 @@
/// Return the name of the variable being declared.
SimpleIdentifier get name;
-
- /// Set the name of the variable being declared to the given [identifier].
- @Deprecated('Clients should not build AST manually')
- set name(SimpleIdentifier identifier);
}
/// The declaration of one or more variables of the same type.
@@ -5792,11 +4325,6 @@
/// `null` if no keyword was included.
Token? get keyword;
- /// Set the token representing the 'final', 'const' or 'var' keyword to the
- /// given [token].
- @Deprecated('Clients should not build AST manually')
- set keyword(Token? token);
-
/// Return the token representing the 'late' keyword, or `null` if the late
/// modifier was not included.
Token? get lateKeyword;
@@ -5805,10 +4333,6 @@
/// provided.
TypeAnnotation? get type;
- /// Set the type of the variables being declared to the given [type].
- @Deprecated('Clients should not build AST manually')
- set type(TypeAnnotation? type);
-
/// Return a list containing the individual variables being declared.
NodeList<VariableDeclaration> get variables;
}
@@ -5824,16 +4348,8 @@
/// Return the semicolon terminating the statement.
Token get semicolon;
- /// Set the semicolon terminating the statement to the given [token].
- @Deprecated('Clients should not build AST manually')
- set semicolon(Token token);
-
/// Return the variables being declared.
VariableDeclarationList get variables;
-
- /// Set the variables being declared to the given list of [variables].
- @Deprecated('Clients should not build AST manually')
- set variables(VariableDeclarationList variables);
}
/// A while statement.
@@ -5846,39 +4362,18 @@
/// Return the body of the loop.
Statement get body;
- /// Set the body of the loop to the given [statement].
- @Deprecated('Clients should not build AST manually')
- set body(Statement statement);
-
/// Return the expression used to determine whether to execute the body of the
/// loop.
Expression get condition;
- /// Set the expression used to determine whether to execute the body of the
- /// loop to the given [expression].
- @Deprecated('Clients should not build AST manually')
- set condition(Expression expression);
-
/// Return the left parenthesis.
Token get leftParenthesis;
- /// Set the left parenthesis to the given [token].
- @Deprecated('Clients should not build AST manually')
- set leftParenthesis(Token token);
-
/// Return the right parenthesis.
Token get rightParenthesis;
- /// Set the right parenthesis to the given [token].
- @Deprecated('Clients should not build AST manually')
- set rightParenthesis(Token token);
-
/// Return the token representing the 'while' keyword.
Token get whileKeyword;
-
- /// Set the token representing the 'while' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set whileKeyword(Token token);
}
/// The with clause in a class declaration.
@@ -5893,10 +4388,6 @@
/// Return the token representing the 'with' keyword.
Token get withKeyword;
-
- /// Set the token representing the 'with' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set withKeyword(Token token);
}
/// A yield statement.
@@ -5909,29 +4400,12 @@
/// Return the expression whose value will be yielded.
Expression get expression;
- /// Set the expression whose value will be yielded to the given [expression].
- @Deprecated('Clients should not build AST manually')
- set expression(Expression expression);
-
/// Return the semicolon following the expression.
Token get semicolon;
- /// Return the semicolon following the expression to the given [token].
- @Deprecated('Clients should not build AST manually')
- set semicolon(Token token);
-
/// Return the star optionally following the 'yield' keyword.
Token? get star;
- /// Return the star optionally following the 'yield' keyword to the given
- /// [token].
- @Deprecated('Clients should not build AST manually')
- set star(Token? token);
-
/// Return the 'yield' keyword.
Token get yieldKeyword;
-
- /// Return the 'yield' keyword to the given [token].
- @Deprecated('Clients should not build AST manually')
- set yieldKeyword(Token token);
}
diff --git a/pkg/analyzer/lib/dart/constant/value.dart b/pkg/analyzer/lib/dart/constant/value.dart
index def4a14..12c83db 100644
--- a/pkg/analyzer/lib/dart/constant/value.dart
+++ b/pkg/analyzer/lib/dart/constant/value.dart
@@ -62,7 +62,7 @@
///
/// This method can return a representation of the type, even if this object
/// would return `false` from [hasKnownValue].
- ParameterizedType? get type;
+ DartType? get type;
/// Return a representation of the value of the field with the given [name].
///
diff --git a/pkg/analyzer/lib/dart/element/element.dart b/pkg/analyzer/lib/dart/element/element.dart
index 06d3348e..77c23d9 100644
--- a/pkg/analyzer/lib/dart/element/element.dart
+++ b/pkg/analyzer/lib/dart/element/element.dart
@@ -405,11 +405,6 @@
/// compilation unit.
List<FunctionElement> get functions;
- /// Return a list containing all of the function type aliases contained in
- /// this compilation unit.
- @Deprecated('Use typeAliases instead')
- List<FunctionTypeAliasElement> get functionTypeAliases;
-
/// Return `true` if this compilation unit defines a top-level function named
/// `loadLibrary`.
@Deprecated('Not useful for clients')
@@ -1034,9 +1029,6 @@
R? visitFunctionElement(FunctionElement element);
- @Deprecated('Override visitTypeAliasElement() instead')
- R? visitFunctionTypeAliasElement(FunctionTypeAliasElement element);
-
R? visitGenericFunctionTypeElement(GenericFunctionTypeElement element);
R? visitImportElement(ImportElement element);
@@ -1232,31 +1224,6 @@
bool get isEntryPoint;
}
-/// A function type alias (`typedef`).
-///
-/// This class models a type alias whose body specifies a function type, as
-/// is the only possible kind of type alias before the generalization that
-/// allows the body to be an arbitrary type.
-///
-/// This class will be deprecated and [TypeAliasElement] will replace it
-/// when non-function type aliases are enabled by default.
-///
-/// Clients may not extend, implement or mix-in this class.
-@Deprecated('Use TypeAliasElement instead')
-abstract class FunctionTypeAliasElement implements TypeAliasElement {
- /// Return the generic function type element representing the generic function
- /// type on the right side of the equals.
- @Deprecated('Use aliasedElement instead')
- GenericFunctionTypeElement get function;
-
- @Deprecated('Use TypeAliasElement instead')
- @override
- FunctionType instantiate({
- required List<DartType> typeArguments,
- required NullabilitySuffix nullabilitySuffix,
- });
-}
-
/// An element that has a [FunctionType] as its [type].
///
/// This also provides convenient access to the parameters and return type.
diff --git a/pkg/analyzer/lib/dart/element/scope.dart b/pkg/analyzer/lib/dart/element/scope.dart
index 82b2c0d..0fdfa0c 100644
--- a/pkg/analyzer/lib/dart/element/scope.dart
+++ b/pkg/analyzer/lib/dart/element/scope.dart
@@ -12,14 +12,6 @@
/// done with the lookup, and return both the getter and the setter, if
/// available.
ScopeLookupResult lookup(String id);
-
- /// Return the result of lexical lookup for the given [id], not `null`.
- ///
- /// Getters and setters are bundled, when we found one or another, we are
- /// done with the lookup, and return both the getter and the setter, if
- /// available.
- @Deprecated('Use lookup() instead')
- ScopeLookupResult lookup2(String id);
}
class ScopeLookupResult {
diff --git a/pkg/analyzer/lib/dart/element/type.dart b/pkg/analyzer/lib/dart/element/type.dart
index e772019..44efa9f 100644
--- a/pkg/analyzer/lib/dart/element/type.dart
+++ b/pkg/analyzer/lib/dart/element/type.dart
@@ -194,11 +194,7 @@
/// T<sub>xk</sub> xk}) → T</i>.
///
/// Clients may not extend, implement or mix-in this class.
-abstract class FunctionType implements ParameterizedType {
- @Deprecated('Use aliasElement instead')
- @override
- FunctionTypedElement? get element;
-
+abstract class FunctionType implements DartType {
/// Return a map from the names of named parameters to the types of the named
/// parameters of this type of function. The entries in the map will be
/// iterated in the same order as the order in which the named parameters were
@@ -234,10 +230,6 @@
/// Return the type of object returned by this type of function.
DartType get returnType;
- @Deprecated('Use aliasArguments instead')
- @override
- List<DartType> get typeArguments;
-
/// The formal type parameters of this generic function.
/// For example `<T> T -> T`.
///
diff --git a/pkg/analyzer/lib/dart/element/visitor.dart b/pkg/analyzer/lib/dart/element/visitor.dart
index 7da9bd6..0654527 100644
--- a/pkg/analyzer/lib/dart/element/visitor.dart
+++ b/pkg/analyzer/lib/dart/element/visitor.dart
@@ -118,11 +118,6 @@
R? visitFunctionElement(FunctionElement element) =>
visitLocalElement(element);
- @Deprecated('Override visitTypeAliasElement() instead')
- @override
- R? visitFunctionTypeAliasElement(FunctionTypeAliasElement element) =>
- visitElement(element);
-
@override
R? visitGenericFunctionTypeElement(GenericFunctionTypeElement element) =>
visitElement(element);
@@ -250,13 +245,6 @@
return null;
}
- @Deprecated('Override visitTypeAliasElement() instead')
- @override
- R? visitFunctionTypeAliasElement(FunctionTypeAliasElement element) {
- element.visitChildren(this);
- return null;
- }
-
@override
R? visitGenericFunctionTypeElement(GenericFunctionTypeElement element) {
element.visitChildren(this);
@@ -371,10 +359,6 @@
@override
R? visitFunctionElement(FunctionElement element) => null;
- @Deprecated('Override visitTypeAliasElement() instead')
- @override
- R? visitFunctionTypeAliasElement(FunctionTypeAliasElement element) => null;
-
@override
R? visitGenericFunctionTypeElement(GenericFunctionTypeElement element) =>
null;
@@ -453,11 +437,6 @@
@override
R? visitFunctionElement(FunctionElement element) => _throw(element);
- @Deprecated('Override visitTypeAliasElement() instead')
- @override
- R? visitFunctionTypeAliasElement(FunctionTypeAliasElement element) =>
- _throw(element);
-
@override
R? visitGenericFunctionTypeElement(GenericFunctionTypeElement element) =>
_throw(element);
diff --git a/pkg/analyzer/lib/error/error.dart b/pkg/analyzer/lib/error/error.dart
index 8c8eb94..6a6fa5a 100644
--- a/pkg/analyzer/lib/error/error.dart
+++ b/pkg/analyzer/lib/error/error.dart
@@ -471,6 +471,7 @@
FfiCode.EXTRA_SIZE_ANNOTATION_CARRAY,
FfiCode.FIELD_IN_STRUCT_WITH_INITIALIZER,
FfiCode.FIELD_INITIALIZER_IN_STRUCT,
+ FfiCode.FIELD_MUST_BE_EXTERNAL_IN_STRUCT,
FfiCode.GENERIC_STRUCT_SUBCLASS,
FfiCode.INVALID_EXCEPTION_VALUE,
FfiCode.INVALID_FIELD_TYPE_IN_STRUCT,
diff --git a/pkg/analyzer/lib/source/line_info.dart b/pkg/analyzer/lib/source/line_info.dart
index 71d4d91..1867017 100644
--- a/pkg/analyzer/lib/source/line_info.dart
+++ b/pkg/analyzer/lib/source/line_info.dart
@@ -3,17 +3,21 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:analyzer/src/generated/java_engine.dart';
-import 'package:analyzer/src/generated/source.dart';
/// The location of a character represented as a line and column pair.
-// ignore: deprecated_member_use_from_same_package
-class CharacterLocation extends LineInfo_Location {
- // TODO(brianwilkerson) Replace the body of this class with the body of
- // LineInfo_Location and remove LineInfo_Location.
+class CharacterLocation {
+ /// The one-based index of the line containing the character.
+ final int lineNumber;
+
+ /// The one-based index of the column containing the character.
+ final int columnNumber;
+
/// Initialize a newly created location to represent the location of the
/// character at the given [lineNumber] and [columnNumber].
- CharacterLocation(int lineNumber, int columnNumber)
- : super(lineNumber, columnNumber);
+ CharacterLocation(this.lineNumber, this.columnNumber);
+
+ @override
+ String toString() => '$lineNumber:$columnNumber';
}
/// Information about line and column information within a source file.
@@ -43,12 +47,7 @@
int get lineCount => lineStarts.length;
/// Return the location information for the character at the given [offset].
- ///
- /// A future version of this API will return a [CharacterLocation] rather than
- // ignore: deprecated_member_use_from_same_package
- /// a [LineInfo_Location].
- // ignore: deprecated_member_use_from_same_package
- LineInfo_Location getLocation(int offset) {
+ CharacterLocation getLocation(int offset) {
var min = 0;
var max = lineStarts.length - 1;
diff --git a/pkg/analyzer/lib/src/dart/analysis/driver.dart b/pkg/analyzer/lib/src/dart/analysis/driver.dart
index eed9bdc..832c3ee 100644
--- a/pkg/analyzer/lib/src/dart/analysis/driver.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/driver.dart
@@ -10,7 +10,6 @@
import 'package:analyzer/dart/analysis/results.dart';
import 'package:analyzer/dart/analysis/session.dart';
import 'package:analyzer/dart/ast/ast.dart';
-import 'package:analyzer/dart/element/element.dart' show LibraryElement;
import 'package:analyzer/error/error.dart';
import 'package:analyzer/error/listener.dart';
import 'package:analyzer/exception/exception.dart';
@@ -580,26 +579,6 @@
///
/// This method does not use analysis priorities, and must not be used in
/// interactive analysis, such as Analysis Server or its plugins.
- @Deprecated('Use getErrors2() instead')
- Future<ErrorsResult> getErrors(String path) async {
- _throwIfNotAbsolutePath(path);
-
- var result = await getErrors2(path);
-
- if (result is NotPathOfUriResult) {
- return NotValidErrorsResultImpl(ResultState.NOT_FILE_OF_URI);
- }
-
- return result as ErrorsResult;
- }
-
- /// Return a [Future] that completes with the [ErrorsResult] for the Dart
- /// file with the given [path].
- ///
- /// The [path] must be absolute and normalized.
- ///
- /// This method does not use analysis priorities, and must not be used in
- /// interactive analysis, such as Analysis Server or its plugins.
Future<SomeErrorsResult> getErrors2(String path) async {
if (!_isAbsolutePath(path)) {
return Future.value(
@@ -644,15 +623,6 @@
/// Return the [FileResult] for the Dart file with the given [path].
///
/// The [path] must be absolute and normalized.
- @Deprecated('Use getFileSync2() instead')
- FileResult getFileSync(String path) {
- _throwIfNotAbsolutePath(path);
- return getFileSync2(path) as FileResult;
- }
-
- /// Return the [FileResult] for the Dart file with the given [path].
- ///
- /// The [path] must be absolute and normalized.
SomeFileResult getFileSync2(String path) {
if (!_isAbsolutePath(path)) {
return InvalidPathResult();
@@ -682,41 +652,6 @@
return completer.future;
}
- /// Return a [Future] that completes with the [LibraryElement] for the given
- /// [uri], which is either resynthesized from the provided external summary
- /// store, or built for a file to which the given [uri] is resolved.
- ///
- /// Throw [ArgumentError] if the [uri] does not correspond to a file.
- ///
- /// Throw [ArgumentError] if the [uri] corresponds to a part.
- @Deprecated('Use getLibraryByUri2() instead')
- Future<LibraryElement> getLibraryByUri(String uri) async {
- var uriObj = Uri.parse(uri);
- var fileOr = _fsState.getFileForUri(uriObj);
- return fileOr.map(
- (file) async {
- if (file == null) {
- throw ArgumentError('$uri cannot be resolved to a file.');
- }
-
- if (file.isPart) {
- throw ArgumentError('$uri is not a library.');
- }
-
- var unitResult = await getUnitElement2(file.path);
- if (unitResult is! UnitElementResult) {
- throw ArgumentError('$uri has no valid result.');
- }
-
- return unitResult.element.library;
- },
- (externalLibrary) async {
- var libraryContext = _createLibraryContext(null);
- return libraryContext.getLibraryElement(externalLibrary.uri);
- },
- );
- }
-
/// Return a [Future] that completes with [LibraryElementResult] for the given
/// [uri], which is either resynthesized from the provided external summary
/// store, or built for a file to which the given [uri] is resolved.
@@ -804,29 +739,6 @@
}
/// Return a [ParsedLibraryResult] for the library with the given [uri].
- ///
- /// Throw [ArgumentError] if the given [uri] is not the defining compilation
- /// unit for a library (that is, is a part of a library).
- @Deprecated('Use getParsedLibraryByUri2() instead')
- ParsedLibraryResult getParsedLibraryByUri(Uri uri) {
- var fileOr = _fsState.getFileForUri(uri);
- return fileOr.map(
- (file) {
- if (file == null) {
- throw ArgumentError('URI cannot be resolved: $uri');
- }
- if (file.isPart) {
- throw ArgumentError('Is a part: $uri');
- }
- return getParsedLibrary(file.path);
- },
- (externalLibrary) {
- return ParsedLibraryResultImpl.external(currentSession, uri);
- },
- );
- }
-
- /// Return a [ParsedLibraryResult] for the library with the given [uri].
SomeParsedLibraryResult getParsedLibraryByUri2(Uri uri) {
var fileOr = _fsState.getFileForUri(uri);
return fileOr.map(
@@ -846,41 +758,6 @@
}
/// Return a [Future] that completes with a [ResolvedLibraryResult] for the
- /// Dart library file with the given [path]. If the file is not a Dart file
- /// or cannot be analyzed, the [Future] completes with `null`.
- ///
- /// Throw [ArgumentError] if the given [path] is not the defining compilation
- /// unit for a library (that is, is a part of a library).
- ///
- /// The [path] must be absolute and normalized.
- ///
- /// The [path] can be any file - explicitly or implicitly analyzed, or neither.
- ///
- /// Invocation of this method causes the analysis state to transition to
- /// "analyzing" (if it is not in that state already), the driver will produce
- /// the resolution result for it, which is consistent with the current file
- /// state (including new states of the files previously reported using
- /// [changeFile]), prior to the next time the analysis state transitions
- /// to "idle".
- @Deprecated('Use getResolvedLibrary2() instead')
- Future<ResolvedLibraryResult> getResolvedLibrary(String path) async {
- _throwIfNotAbsolutePath(path);
-
- var result = await getResolvedLibrary2(path);
-
- if (result is NotPathOfUriResult) {
- // ignore: null_argument_to_non_null_type
- return Future.value(); // bug?
- }
-
- if (result is NotLibraryButPartResult) {
- throw ArgumentError('Is a part: $path');
- }
-
- return result as ResolvedLibraryResult;
- }
-
- /// Return a [Future] that completes with a [ResolvedLibraryResult] for the
/// Dart library file with the given [path]. If the file cannot be analyzed,
/// the [Future] completes with an [InvalidResult].
///
@@ -925,37 +802,6 @@
}
/// Return a [Future] that completes with a [ResolvedLibraryResult] for the
- /// Dart library file with the given [uri].
- ///
- /// Throw [ArgumentError] if the given [uri] is not the defining compilation
- /// unit for a library (that is, is a part of a library).
- ///
- /// Invocation of this method causes the analysis state to transition to
- /// "analyzing" (if it is not in that state already), the driver will produce
- /// the resolution result for it, which is consistent with the current file
- /// state (including new states of the files previously reported using
- /// [changeFile]), prior to the next time the analysis state transitions
- /// to "idle".
- @Deprecated('Use getResolvedLibraryByUri2() instead')
- Future<ResolvedLibraryResult> getResolvedLibraryByUri(Uri uri) {
- var fileOr = _fsState.getFileForUri(uri);
- return fileOr.map(
- (file) {
- if (file == null) {
- throw ArgumentError('URI cannot be resolved: $uri');
- }
- if (file.isPart) {
- throw ArgumentError('Is a part: $uri');
- }
- return getResolvedLibrary(file.path);
- },
- (externalLibrary) async {
- return ResolvedLibraryResultImpl.external(currentSession, uri);
- },
- );
- }
-
- /// Return a [Future] that completes with a [ResolvedLibraryResult] for the
/// Dart library file with the given [uri]. If the file cannot be analyzed,
/// the [Future] completes with an [InvalidResult].
///
@@ -994,35 +840,6 @@
return signature;
}
- /// Return a [Future] that completes with a [ResolvedUnitResult] for the Dart
- /// file with the given [path].
- ///
- /// The [path] must be absolute and normalized.
- ///
- /// The [path] can be any file - explicitly or implicitly analyzed, or neither.
- ///
- /// If the driver has the cached analysis result for the file, it is returned.
- /// If [sendCachedToStream] is `true`, then the result is also reported into
- /// the [results] stream, just as if it were freshly computed.
- ///
- /// Otherwise causes the analysis state to transition to "analyzing" (if it is
- /// not in that state already), the driver will produce the analysis result for
- /// it, which is consistent with the current file state (including new states
- /// of the files previously reported using [changeFile]), prior to the next
- /// time the analysis state transitions to "idle".
- @Deprecated('Use getResult2() instead')
- Future<ResolvedUnitResult> getResult(String path,
- {bool sendCachedToStream = false}) async {
- _throwIfNotAbsolutePath(path);
-
- var result = await getResult2(path, sendCachedToStream: sendCachedToStream);
- if (result is NotPathOfUriResult) {
- return NotValidResolvedUnitResultImpl(ResultState.NOT_FILE_OF_URI);
- }
-
- return result as ResolvedUnitResult;
- }
-
/// Return a [Future] that completes with a [SomeResolvedUnitResult] for the
/// Dart file with the given [path]. If the file cannot be analyzed,
/// the [Future] completes with an [InvalidResult].
@@ -1074,37 +891,6 @@
return completer.future;
}
- /// Return a [Future] that completes with the [SourceKind] for the Dart
- /// file with the given [path]. If the file is not a Dart file or cannot
- /// be analyzed, the [Future] completes with `null`.
- ///
- /// The [path] must be absolute and normalized.
- @Deprecated('Use getFileSync2() instead')
- Future<SourceKind?> getSourceKind(String path) async {
- _throwIfNotAbsolutePath(path);
- if (file_paths.isDart(resourceProvider.pathContext, path)) {
- FileState file = _fileTracker.getFile(path);
- return file.isPart ? SourceKind.PART : SourceKind.LIBRARY;
- }
- return null;
- }
-
- /// Return a [Future] that completes with the [UnitElementResult] for the
- /// file with the given [path].
- @Deprecated('Use getUnitElement2() instead')
- Future<UnitElementResult> getUnitElement(String path) async {
- _throwIfNotAbsolutePath(path);
- var result = await getUnitElement2(path);
-
- if (result is NotPathOfUriResult) {
- return Future.value(
- NotValidUnitElementResultImpl(ResultState.NOT_FILE_OF_URI),
- );
- }
-
- return result as UnitElementResult;
- }
-
/// Return a [Future] that completes with the [SomeUnitElementResult]
/// for the file with the given [path].
Future<SomeUnitElementResult> getUnitElement2(String path) {
@@ -1128,27 +914,6 @@
return completer.future;
}
- /// Return a [Future] that completes with the signature for the
- /// [UnitElementResult] for the file with the given [path], or with `null` if
- /// the file cannot be analyzed.
- ///
- /// The signature is based the APIs of the files of the library (including
- /// the file itself) of the requested file and the transitive closure of files
- /// imported and exported by the library.
- @Deprecated('This method is not used and will be removed')
- Future<String> getUnitElementSignature(String path) {
- _throwIfNotAbsolutePath(path);
- if (!_fsState.hasUri(path)) {
- return Future.value(); // ignore: null_argument_to_non_null_type
- }
- var completer = Completer<String>();
- _unitElementSignatureFiles
- .putIfAbsent(path, () => <Completer<String>>[])
- .add(completer);
- _scheduler.notify(this);
- return completer.future;
- }
-
/// Return `true` is the file with the given absolute [uri] is a library,
/// or `false` if it is a part. More specifically, return `true` if the file
/// is not known to be a part.
@@ -1176,21 +941,6 @@
/// The parsing is performed in the method itself, and the result is not
/// produced through the [results] stream (just because it is not a fully
/// resolved unit).
- @Deprecated('Use parseFile2() instead')
- Future<ParsedUnitResult> parseFile(String path) async {
- return parseFileSync(path);
- }
-
- /// Return a [Future] that completes with a [ParsedUnitResult] for the file
- /// with the given [path].
- ///
- /// The [path] must be absolute and normalized.
- ///
- /// The [path] can be any file - explicitly or implicitly analyzed, or neither.
- ///
- /// The parsing is performed in the method itself, and the result is not
- /// produced through the [results] stream (just because it is not a fully
- /// resolved unit).
Future<SomeParsedUnitResult> parseFile2(String path) async {
return parseFileSync2(path);
}
@@ -1204,22 +954,6 @@
/// The parsing is performed in the method itself, and the result is not
/// produced through the [results] stream (just because it is not a fully
/// resolved unit).
- @Deprecated('Use parseFileSync2() instead')
- ParsedUnitResult parseFileSync(String path) {
- _throwIfNotAbsolutePath(path);
-
- return parseFileSync2(path) as ParsedUnitResult;
- }
-
- /// Return a [ParsedUnitResult] for the file with the given [path].
- ///
- /// The [path] must be absolute and normalized.
- ///
- /// The [path] can be any file - explicitly or implicitly analyzed, or neither.
- ///
- /// The parsing is performed in the method itself, and the result is not
- /// produced through the [results] stream (just because it is not a fully
- /// resolved unit).
SomeParsedUnitResult parseFileSync2(String path) {
if (!_isAbsolutePath(path)) {
return InvalidPathResult();
diff --git a/pkg/analyzer/lib/src/dart/analysis/session.dart b/pkg/analyzer/lib/src/dart/analysis/session.dart
index a8d21a5..288882e 100644
--- a/pkg/analyzer/lib/src/dart/analysis/session.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/session.dart
@@ -16,7 +16,6 @@
import 'package:analyzer/src/dart/element/type_provider.dart';
import 'package:analyzer/src/dart/element/type_system.dart';
import 'package:analyzer/src/generated/engine.dart' show AnalysisOptionsImpl;
-import 'package:analyzer/src/generated/source.dart';
/// A concrete implementation of an analysis session.
class AnalysisSessionImpl implements AnalysisSession {
@@ -26,9 +25,6 @@
/// The URI converter used to convert between URI's and file paths.
UriConverter? _uriConverter;
- /// The cache of libraries for URIs.
- final Map<String, LibraryElement> _uriToLibraryCache = {};
-
ClassHierarchy classHierarchy = ClassHierarchy();
InheritanceManager3 inheritanceManager = InheritanceManager3();
@@ -58,71 +54,30 @@
@deprecated
driver.AnalysisDriver getDriver() => _driver;
- @Deprecated('Use getErrors2() instead')
- @override
- Future<ErrorsResult> getErrors(String path) {
- _checkConsistency();
- return _driver.getErrors(path);
- }
-
@override
Future<SomeErrorsResult> getErrors2(String path) {
_checkConsistency();
return _driver.getErrors2(path);
}
- @Deprecated('Use getFile2() instead')
- @override
- FileResult getFile(String path) {
- _checkConsistency();
- return _driver.getFileSync(path);
- }
-
@override
SomeFileResult getFile2(String path) {
_checkConsistency();
return _driver.getFileSync2(path);
}
- @Deprecated('Use getLibraryByUri2() instead')
- @override
- Future<LibraryElement> getLibraryByUri(String uri) async {
- _checkConsistency();
- var libraryElement = _uriToLibraryCache[uri];
- if (libraryElement == null) {
- libraryElement = await _driver.getLibraryByUri(uri);
- _uriToLibraryCache[uri] = libraryElement;
- }
- return libraryElement;
- }
-
@override
Future<SomeLibraryElementResult> getLibraryByUri2(String uri) {
_checkConsistency();
return _driver.getLibraryByUri2(uri);
}
- @Deprecated('Use getParsedLibrary2() instead')
- @override
- ParsedLibraryResult getParsedLibrary(String path) {
- _checkConsistency();
- return _driver.getParsedLibrary(path);
- }
-
@override
SomeParsedLibraryResult getParsedLibrary2(String path) {
_checkConsistency();
return _driver.getParsedLibrary2(path);
}
- @Deprecated('Use getParsedLibraryByElement2() instead')
- @override
- ParsedLibraryResult getParsedLibraryByElement(LibraryElement element) {
- _checkConsistency();
- _checkElementOfThisSession(element);
- return _driver.getParsedLibraryByUri(element.source.uri);
- }
-
@override
SomeParsedLibraryResult getParsedLibraryByElement2(LibraryElement element) {
_checkConsistency();
@@ -134,41 +89,18 @@
return _driver.getParsedLibraryByUri2(element.source.uri);
}
- @Deprecated('Use getParsedUnit2() instead')
- @override
- ParsedUnitResult getParsedUnit(String path) {
- _checkConsistency();
- return _driver.parseFileSync(path);
- }
-
@override
SomeParsedUnitResult getParsedUnit2(String path) {
_checkConsistency();
return _driver.parseFileSync2(path);
}
- @Deprecated('Use getResolvedLibrary2() instead')
- @override
- Future<ResolvedLibraryResult> getResolvedLibrary(String path) {
- _checkConsistency();
- return _driver.getResolvedLibrary(path);
- }
-
@override
Future<SomeResolvedLibraryResult> getResolvedLibrary2(String path) {
_checkConsistency();
return _driver.getResolvedLibrary2(path);
}
- @Deprecated('Use getResolvedLibraryByElement2() instead')
- @override
- Future<ResolvedLibraryResult> getResolvedLibraryByElement(
- LibraryElement element) {
- _checkConsistency();
- _checkElementOfThisSession(element);
- return _driver.getResolvedLibraryByUri(element.source.uri);
- }
-
@override
Future<SomeResolvedLibraryResult> getResolvedLibraryByElement2(
LibraryElement element,
@@ -184,46 +116,18 @@
return _driver.getResolvedLibraryByUri2(element.source.uri);
}
- @Deprecated('Use getResolvedUnit2() instead')
- @override
- Future<ResolvedUnitResult> getResolvedUnit(String path) {
- _checkConsistency();
- return _driver.getResult(path);
- }
-
@override
Future<SomeResolvedUnitResult> getResolvedUnit2(String path) {
_checkConsistency();
return _driver.getResult2(path);
}
- @Deprecated('Use getFile2() instead')
- @override
- Future<SourceKind?> getSourceKind(String path) {
- _checkConsistency();
- return _driver.getSourceKind(path);
- }
-
- @Deprecated('Use getUnitElement2() instead')
- @override
- Future<UnitElementResult> getUnitElement(String path) {
- _checkConsistency();
- return _driver.getUnitElement(path);
- }
-
@override
Future<SomeUnitElementResult> getUnitElement2(String path) {
_checkConsistency();
return _driver.getUnitElement2(path);
}
- @Deprecated('This method is not used and will be removed')
- @override
- Future<String> getUnitElementSignature(String path) {
- _checkConsistency();
- return _driver.getUnitElementSignature(path);
- }
-
/// Check to see that results from this session will be consistent, and throw
/// an [InconsistentAnalysisException] if they might not be.
void _checkConsistency() {
@@ -231,15 +135,6 @@
throw InconsistentAnalysisException();
}
}
-
- void _checkElementOfThisSession(Element element) {
- if (element.session != this) {
- var elementStr = element.getDisplayString(withNullability: true);
- throw ArgumentError(
- '(${element.runtimeType}) $elementStr was not produced by '
- 'this session.');
- }
- }
}
/// Data structure containing information about the analysis session that is
diff --git a/pkg/analyzer/lib/src/dart/ast/ast.dart b/pkg/analyzer/lib/src/dart/ast/ast.dart
index 3bc2bc1..874c8f5 100644
--- a/pkg/analyzer/lib/src/dart/ast/ast.dart
+++ b/pkg/analyzer/lib/src/dart/ast/ast.dart
@@ -108,7 +108,6 @@
@override
CommentImpl? get documentationComment => _comment;
- @override
set documentationComment(Comment? comment) {
_comment = _becomeParentOf(comment as CommentImpl?);
}
@@ -228,7 +227,6 @@
@override
ArgumentListImpl? get arguments => _arguments;
- @override
set arguments(ArgumentList? arguments) {
_arguments = _becomeParentOf(arguments as ArgumentListImpl?);
}
@@ -248,7 +246,6 @@
@override
SimpleIdentifierImpl? get constructorName => _constructorName;
- @override
set constructorName(SimpleIdentifier? name) {
_constructorName = _becomeParentOf(name as SimpleIdentifierImpl?);
}
@@ -263,7 +260,6 @@
return null;
}
- @override
set element(Element? element) {
_element = element;
}
@@ -281,7 +277,6 @@
@override
IdentifierImpl get name => _name;
- @override
set name(Identifier name) {
_name = _becomeParentOf(name as IdentifierImpl)!;
}
@@ -362,7 +357,6 @@
List<ParameterElement?>? get correspondingStaticParameters =>
_correspondingStaticParameters;
- @override
set correspondingStaticParameters(List<ParameterElement?>? parameters) {
if (parameters != null && parameters.length != _arguments.length) {
throw ArgumentError(
@@ -442,7 +436,6 @@
@override
ExpressionImpl get expression => _expression;
- @override
set expression(Expression expression) {
_expression = _becomeParentOf(expression as ExpressionImpl);
}
@@ -453,7 +446,6 @@
@override
TypeAnnotationImpl get type => _type;
- @override
set type(TypeAnnotation type) {
_type = _becomeParentOf(type as TypeAnnotationImpl);
}
@@ -515,7 +507,6 @@
@override
ExpressionImpl get condition => _condition;
- @override
set condition(Expression condition) {
_condition = _becomeParentOf(condition as ExpressionImpl);
}
@@ -526,7 +517,6 @@
@override
ExpressionImpl? get message => _message;
- @override
set message(Expression? expression) {
_message = _becomeParentOf(expression as ExpressionImpl?);
}
@@ -591,7 +581,6 @@
@override
ExpressionImpl get condition => _condition;
- @override
set condition(Expression condition) {
_condition = _becomeParentOf(condition as ExpressionImpl);
}
@@ -602,7 +591,6 @@
@override
ExpressionImpl? get message => _message;
- @override
set message(Expression? expression) {
_message = _becomeParentOf(expression as ExpressionImpl);
}
@@ -661,7 +649,6 @@
@override
ExpressionImpl get leftHandSide => _leftHandSide;
- @override
set leftHandSide(Expression expression) {
_leftHandSide = _becomeParentOf(expression as ExpressionImpl);
}
@@ -672,7 +659,6 @@
@override
ExpressionImpl get rightHandSide => _rightHandSide;
- @override
set rightHandSide(Expression expression) {
_rightHandSide = _becomeParentOf(expression as ExpressionImpl);
}
@@ -863,7 +849,6 @@
@override
ExpressionImpl get expression => _expression;
- @override
set expression(Expression expression) {
_expression = _becomeParentOf(expression as ExpressionImpl);
}
@@ -923,7 +908,6 @@
@override
ExpressionImpl get leftOperand => _leftOperand;
- @override
set leftOperand(Expression expression) {
_leftOperand = _becomeParentOf(expression as ExpressionImpl);
}
@@ -934,7 +918,6 @@
@override
ExpressionImpl get rightOperand => _rightOperand;
- @override
set rightOperand(Expression expression) {
_rightOperand = _becomeParentOf(expression as ExpressionImpl);
}
@@ -987,7 +970,6 @@
@override
BlockImpl get block => _block;
- @override
set block(Block block) {
_block = _becomeParentOf(block as BlockImpl);
}
@@ -1144,7 +1126,6 @@
@override
SimpleIdentifierImpl? get label => _label;
- @override
set label(SimpleIdentifier? identifier) {
_label = _becomeParentOf(identifier as SimpleIdentifierImpl?);
}
@@ -1213,7 +1194,6 @@
@override
ExpressionImpl get target => _target;
- @override
set target(Expression target) {
_target = _becomeParentOf(target as ExpressionImpl);
}
@@ -1315,7 +1295,6 @@
@override
BlockImpl get body => _body;
- @override
set body(Block block) {
_body = _becomeParentOf(block as BlockImpl);
}
@@ -1338,7 +1317,6 @@
@override
SimpleIdentifierImpl? get exceptionParameter => _exceptionParameter;
- @override
set exceptionParameter(SimpleIdentifier? parameter) {
_exceptionParameter = _becomeParentOf(parameter as SimpleIdentifierImpl?);
}
@@ -1346,7 +1324,6 @@
@override
TypeAnnotationImpl? get exceptionType => _exceptionType;
- @override
set exceptionType(TypeAnnotation? exceptionType) {
_exceptionType = _becomeParentOf(exceptionType as TypeAnnotationImpl?);
}
@@ -1354,7 +1331,6 @@
@override
SimpleIdentifierImpl? get stackTraceParameter => _stackTraceParameter;
- @override
set stackTraceParameter(SimpleIdentifier? parameter) {
_stackTraceParameter = _becomeParentOf(parameter as SimpleIdentifierImpl?);
}
@@ -1472,7 +1448,6 @@
@override
ExtendsClauseImpl? get extendsClause => _extendsClause;
- @override
set extendsClause(ExtendsClause? extendsClause) {
_extendsClause = _becomeParentOf(extendsClause as ExtendsClauseImpl?);
}
@@ -1488,7 +1463,6 @@
@override
NativeClauseImpl? get nativeClause => _nativeClause;
- @override
set nativeClause(NativeClause? nativeClause) {
_nativeClause = _becomeParentOf(nativeClause as NativeClauseImpl?);
}
@@ -1496,7 +1470,6 @@
@override
WithClauseImpl? get withClause => _withClause;
- @override
set withClause(WithClause? withClause) {
_withClause = _becomeParentOf(withClause as WithClauseImpl?);
}
@@ -1719,7 +1692,6 @@
@override
ImplementsClauseImpl? get implementsClause => _implementsClause;
- @override
set implementsClause(ImplementsClause? implementsClause) {
_implementsClause =
_becomeParentOf(implementsClause as ImplementsClauseImpl?);
@@ -1731,7 +1703,6 @@
@override
TypeNameImpl get superclass => _superclass;
- @override
set superclass(TypeName superclass) {
_superclass = _becomeParentOf(superclass as TypeNameImpl);
}
@@ -1739,7 +1710,6 @@
@override
TypeParameterListImpl? get typeParameters => _typeParameters;
- @override
set typeParameters(TypeParameterList? typeParameters) {
_typeParameters = _becomeParentOf(typeParameters as TypeParameterListImpl);
}
@@ -1747,7 +1717,6 @@
@override
WithClauseImpl get withClause => _withClause;
- @override
set withClause(WithClause withClause) {
_withClause = _becomeParentOf(withClause as WithClauseImpl);
}
@@ -1906,7 +1875,6 @@
@override
IdentifierImpl get identifier => _identifier;
- @override
set identifier(Identifier identifier) {
_identifier = _becomeParentOf(identifier as IdentifierImpl);
}
@@ -2032,7 +2000,6 @@
@override
NodeListImpl<Directive> get directives => _directives;
- @override
set element(CompilationUnitElement? element) {
declaredElement = element;
}
@@ -2066,7 +2033,6 @@
@override
ScriptTag? get scriptTag => _scriptTag;
- @override
set scriptTag(ScriptTag? scriptTag) {
_scriptTag = _becomeParentOf(scriptTag as ScriptTagImpl?);
}
@@ -2189,7 +2155,6 @@
@override
ExpressionImpl get condition => _condition;
- @override
set condition(Expression expression) {
_condition = _becomeParentOf(expression as ExpressionImpl);
}
@@ -2197,7 +2162,6 @@
@override
ExpressionImpl get elseExpression => _elseExpression;
- @override
set elseExpression(Expression expression) {
_elseExpression = _becomeParentOf(expression as ExpressionImpl);
}
@@ -2211,7 +2175,6 @@
@override
ExpressionImpl get thenExpression => _thenExpression;
- @override
set thenExpression(Expression expression) {
_thenExpression = _becomeParentOf(expression as ExpressionImpl);
}
@@ -2286,7 +2249,6 @@
@override
DottedNameImpl get name => _name;
- @override
set name(DottedName name) {
_name = _becomeParentOf(name as DottedNameImpl);
}
@@ -2294,7 +2256,6 @@
@override
StringLiteralImpl get uri => _uri;
- @override
set uri(StringLiteral uri) {
_uri = _becomeParentOf(uri as StringLiteralImpl);
}
@@ -2302,7 +2263,6 @@
@override
StringLiteralImpl? get value => _value;
- @override
set value(StringLiteral? value) {
_value = _becomeParentOf(value as StringLiteralImpl);
}
@@ -2447,7 +2407,6 @@
@override
FunctionBodyImpl get body => _body;
- @override
set body(FunctionBody functionBody) {
_body = _becomeParentOf(functionBody as FunctionBodyImpl);
}
@@ -2484,7 +2443,6 @@
@override
SimpleIdentifierImpl? get name => _name;
- @override
set name(SimpleIdentifier? identifier) {
_name = _becomeParentOf(identifier as SimpleIdentifierImpl?);
}
@@ -2492,7 +2450,6 @@
@override
FormalParameterListImpl get parameters => _parameters;
- @override
set parameters(FormalParameterList parameters) {
_parameters = _becomeParentOf(parameters as FormalParameterListImpl);
}
@@ -2500,7 +2457,6 @@
@override
ConstructorNameImpl? get redirectedConstructor => _redirectedConstructor;
- @override
set redirectedConstructor(ConstructorName? redirectedConstructor) {
_redirectedConstructor =
_becomeParentOf(redirectedConstructor as ConstructorNameImpl);
@@ -2509,7 +2465,6 @@
@override
IdentifierImpl get returnType => _returnType;
- @override
set returnType(Identifier typeName) {
_returnType = _becomeParentOf(typeName as IdentifierImpl);
}
@@ -2586,7 +2541,6 @@
@override
ExpressionImpl get expression => _expression;
- @override
set expression(Expression expression) {
_expression = _becomeParentOf(expression as ExpressionImpl);
}
@@ -2594,7 +2548,6 @@
@override
SimpleIdentifierImpl get fieldName => _fieldName;
- @override
set fieldName(SimpleIdentifier identifier) {
_fieldName = _becomeParentOf(identifier as SimpleIdentifierImpl);
}
@@ -2667,7 +2620,6 @@
@override
SimpleIdentifierImpl? get name => _name;
- @override
set name(SimpleIdentifier? name) {
_name = _becomeParentOf(name as SimpleIdentifierImpl?);
}
@@ -2675,7 +2627,6 @@
@override
TypeNameImpl get type => _type;
- @override
set type(TypeName type) {
_type = _becomeParentOf(type as TypeNameImpl);
}
@@ -2778,7 +2729,6 @@
@override
SimpleIdentifierImpl? get label => _label;
- @override
set label(SimpleIdentifier? identifier) {
_label = _becomeParentOf(identifier as SimpleIdentifierImpl?);
}
@@ -2852,7 +2802,6 @@
@override
SimpleIdentifierImpl get identifier => _identifier;
- @override
set identifier(SimpleIdentifier identifier) {
_identifier = _becomeParentOf(identifier as SimpleIdentifierImpl);
}
@@ -2866,7 +2815,6 @@
@override
TypeAnnotationImpl? get type => _type;
- @override
set type(TypeAnnotation? type) {
_type = _becomeParentOf(type as TypeAnnotationImpl?);
}
@@ -2949,7 +2897,6 @@
@override
ExpressionImpl? get defaultValue => _defaultValue;
- @override
set defaultValue(Expression? expression) {
_defaultValue = _becomeParentOf(expression as ExpressionImpl?);
}
@@ -2977,7 +2924,6 @@
@override
NormalFormalParameterImpl get parameter => _parameter;
- @override
set parameter(NormalFormalParameter formalParameter) {
_parameter = _becomeParentOf(formalParameter as NormalFormalParameterImpl);
}
@@ -3019,7 +2965,6 @@
Element? get element => _element;
/// Set the element associated with this directive to be the given [element].
- @override
set element(Element? element) {
_element = element;
}
@@ -3075,7 +3020,6 @@
@override
StatementImpl get body => _body;
- @override
set body(Statement statement) {
_body = _becomeParentOf(statement as StatementImpl);
}
@@ -3093,7 +3037,6 @@
@override
ExpressionImpl get condition => _condition;
- @override
set condition(Expression expression) {
_condition = _becomeParentOf(expression as ExpressionImpl);
}
@@ -3285,7 +3228,6 @@
@override
SimpleIdentifierImpl get name => _name;
- @override
set name(SimpleIdentifier name) {
_name = _becomeParentOf(name as SimpleIdentifierImpl);
}
@@ -3484,7 +3426,6 @@
@override
ExpressionImpl get expression => _expression;
- @override
set expression(Expression expression) {
_expression = _becomeParentOf(expression as ExpressionImpl);
}
@@ -3629,7 +3570,6 @@
@override
ExpressionImpl get expression => _expression;
- @override
set expression(Expression expression) {
_expression = _becomeParentOf(expression as ExpressionImpl);
}
@@ -3677,7 +3617,6 @@
@override
TypeNameImpl get superclass => _superclass;
- @override
set superclass(TypeName name) {
_superclass = _becomeParentOf(name as TypeNameImpl);
}
@@ -3962,7 +3901,6 @@
@override
VariableDeclarationListImpl get fields => _fieldList;
- @override
set fields(VariableDeclarationList fields) {
_fieldList = _becomeParentOf(fields as VariableDeclarationListImpl);
}
@@ -4093,7 +4031,6 @@
@override
FormalParameterListImpl? get parameters => _parameters;
- @override
set parameters(FormalParameterList? parameters) {
_parameters = _becomeParentOf(parameters as FormalParameterListImpl?);
}
@@ -4101,7 +4038,6 @@
@override
TypeAnnotationImpl? get type => _type;
- @override
set type(TypeAnnotation? type) {
_type = _becomeParentOf(type as TypeAnnotationImpl);
}
@@ -4109,7 +4045,6 @@
@override
TypeParameterListImpl? get typeParameters => _typeParameters;
- @override
set typeParameters(TypeParameterList? typeParameters) {
_typeParameters = _becomeParentOf(typeParameters as TypeParameterListImpl?);
}
@@ -4809,7 +4744,6 @@
@override
FunctionExpressionImpl get functionExpression => _functionExpression;
- @override
set functionExpression(FunctionExpression functionExpression) {
_functionExpression =
_becomeParentOf(functionExpression as FunctionExpressionImpl);
@@ -4824,7 +4758,6 @@
@override
TypeAnnotationImpl? get returnType => _returnType;
- @override
set returnType(TypeAnnotation? type) {
_returnType = _becomeParentOf(type as TypeAnnotationImpl);
}
@@ -4865,7 +4798,6 @@
@override
FunctionDeclarationImpl get functionDeclaration => _functionDeclaration;
- @override
set functionDeclaration(FunctionDeclaration functionDeclaration) {
_functionDeclaration =
_becomeParentOf(functionDeclaration as FunctionDeclarationImpl);
@@ -4921,7 +4853,6 @@
@override
FunctionBodyImpl get body => _body;
- @override
set body(FunctionBody functionBody) {
_body = _becomeParentOf(functionBody as FunctionBodyImpl);
}
@@ -4938,7 +4869,6 @@
@override
FormalParameterListImpl? get parameters => _parameters;
- @override
set parameters(FormalParameterList? parameters) {
_parameters = _becomeParentOf(parameters as FormalParameterListImpl?);
}
@@ -4949,7 +4879,6 @@
@override
TypeParameterListImpl? get typeParameters => _typeParameters;
- @override
set typeParameters(TypeParameterList? typeParameters) {
_typeParameters = _becomeParentOf(typeParameters as TypeParameterListImpl?);
}
@@ -5004,7 +4933,6 @@
@override
ExpressionImpl get function => _function;
- @override
set function(Expression expression) {
_function = _becomeParentOf(expression as ExpressionImpl);
}
@@ -5134,15 +5062,12 @@
..add(semicolon);
@override
- // ignore: deprecated_member_use_from_same_package
- FunctionTypeAliasElement? get declaredElement =>
- // ignore: deprecated_member_use_from_same_package
- _name.staticElement as FunctionTypeAliasElement?;
+ TypeAliasElement? get declaredElement =>
+ _name.staticElement as TypeAliasElement?;
@override
FormalParameterListImpl get parameters => _parameters;
- @override
set parameters(FormalParameterList parameters) {
_parameters = _becomeParentOf(parameters as FormalParameterListImpl);
}
@@ -5150,7 +5075,6 @@
@override
TypeAnnotationImpl? get returnType => _returnType;
- @override
set returnType(TypeAnnotation? type) {
_returnType = _becomeParentOf(type as TypeAnnotationImpl?);
}
@@ -5158,7 +5082,6 @@
@override
TypeParameterListImpl? get typeParameters => _typeParameters;
- @override
set typeParameters(TypeParameterList? typeParameters) {
_typeParameters = _becomeParentOf(typeParameters as TypeParameterListImpl?);
}
@@ -5252,7 +5175,6 @@
@override
FormalParameterListImpl get parameters => _parameters;
- @override
set parameters(FormalParameterList parameters) {
_parameters = _becomeParentOf(parameters as FormalParameterListImpl);
}
@@ -5260,7 +5182,6 @@
@override
TypeAnnotationImpl? get returnType => _returnType;
- @override
set returnType(TypeAnnotation? type) {
_returnType = _becomeParentOf(type as TypeAnnotationImpl?);
}
@@ -5268,7 +5189,6 @@
@override
TypeParameterListImpl? get typeParameters => _typeParameters;
- @override
set typeParameters(TypeParameterList? typeParameters) {
_typeParameters = _becomeParentOf(typeParameters as TypeParameterListImpl?);
}
@@ -5367,7 +5287,6 @@
@override
FormalParameterListImpl get parameters => _parameters;
- @override
set parameters(FormalParameterList parameters) {
_parameters = _becomeParentOf(parameters as FormalParameterListImpl);
}
@@ -5375,7 +5294,6 @@
@override
TypeAnnotationImpl? get returnType => _returnType;
- @override
set returnType(TypeAnnotation? type) {
_returnType = _becomeParentOf(type as TypeAnnotationImpl?);
}
@@ -5387,7 +5305,6 @@
/// Set the type parameters for the function type to the given list of
/// [typeParameters].
- @override
set typeParameters(TypeParameterList? typeParameters) {
_typeParameters = _becomeParentOf(typeParameters as TypeParameterListImpl?);
}
@@ -5462,7 +5379,6 @@
return type is GenericFunctionTypeImpl ? type : null;
}
- @override
set functionType(GenericFunctionType? functionType) {
_type = _becomeParentOf(functionType as GenericFunctionTypeImpl?)!;
}
@@ -5478,7 +5394,6 @@
@override
TypeParameterListImpl? get typeParameters => _typeParameters;
- @override
set typeParameters(TypeParameterList? typeParameters) {
_typeParameters = _becomeParentOf(typeParameters as TypeParameterListImpl?);
}
@@ -5685,7 +5600,6 @@
@override
ExpressionImpl get condition => _condition;
- @override
set condition(Expression condition) {
_condition = _becomeParentOf(condition as ExpressionImpl);
}
@@ -5693,7 +5607,6 @@
@override
StatementImpl? get elseStatement => _elseStatement;
- @override
set elseStatement(Statement? statement) {
_elseStatement = _becomeParentOf(statement as StatementImpl?);
}
@@ -5709,7 +5622,6 @@
@override
StatementImpl get thenStatement => _thenStatement;
- @override
set thenStatement(Statement statement) {
_thenStatement = _becomeParentOf(statement as StatementImpl);
}
@@ -5827,7 +5739,6 @@
@override
SimpleIdentifierImpl? get prefix => _prefix;
- @override
set prefix(SimpleIdentifier? identifier) {
_prefix = _becomeParentOf(identifier as SimpleIdentifierImpl?);
}
@@ -5918,7 +5829,6 @@
@override
ExpressionImpl get index => _index;
- @override
set index(Expression expression) {
_index = _becomeParentOf(expression as ExpressionImpl);
}
@@ -5954,7 +5864,6 @@
@override
ExpressionImpl? get target => _target;
- @override
set target(Expression? expression) {
_target = _becomeParentOf(expression as ExpressionImpl?);
}
@@ -6079,7 +5988,6 @@
@override
ArgumentListImpl get argumentList => _argumentList;
- @override
set argumentList(ArgumentList argumentList) {
_argumentList = _becomeParentOf(argumentList as ArgumentListImpl);
}
@@ -6097,7 +6005,6 @@
@override
ConstructorNameImpl get constructorName => _constructorName;
- @override
set constructorName(ConstructorName name) {
_constructorName = _becomeParentOf(name as ConstructorNameImpl);
}
@@ -6301,7 +6208,6 @@
@override
ExpressionImpl get expression => _expression;
- @override
set expression(Expression expression) {
_expression = _becomeParentOf(expression as ExpressionImpl);
}
@@ -6446,7 +6352,6 @@
@override
ExpressionImpl get expression => _expression;
- @override
set expression(Expression expression) {
_expression = _becomeParentOf(expression as ExpressionImpl);
}
@@ -6457,7 +6362,6 @@
@override
TypeAnnotationImpl get type => _type;
- @override
set type(TypeAnnotation type) {
_type = _becomeParentOf(type as TypeAnnotationImpl);
}
@@ -6511,7 +6415,6 @@
@override
StatementImpl get statement => _statement;
- @override
set statement(Statement statement) {
_statement = _becomeParentOf(statement as StatementImpl);
}
@@ -6559,7 +6462,6 @@
@override
SimpleIdentifierImpl get label => _label;
- @override
set label(SimpleIdentifier label) {
_label = _becomeParentOf(label as SimpleIdentifierImpl);
}
@@ -6614,7 +6516,6 @@
@override
LibraryIdentifierImpl get name => _name;
- @override
set name(LibraryIdentifier name) {
_name = _becomeParentOf(name as LibraryIdentifierImpl);
}
@@ -6824,7 +6725,6 @@
@override
ExpressionImpl get key => _key;
- @override
set key(Expression string) {
_key = _becomeParentOf(string as ExpressionImpl);
}
@@ -6832,7 +6732,6 @@
@override
ExpressionImpl get value => _value;
- @override
set value(Expression expression) {
_value = _becomeParentOf(expression as ExpressionImpl);
}
@@ -6930,7 +6829,6 @@
@override
FunctionBodyImpl get body => _body;
- @override
set body(FunctionBody functionBody) {
_body = _becomeParentOf(functionBody as FunctionBodyImpl);
}
@@ -6988,7 +6886,6 @@
@override
SimpleIdentifierImpl get name => _name;
- @override
set name(SimpleIdentifier identifier) {
_name = _becomeParentOf(identifier as SimpleIdentifierImpl);
}
@@ -6996,7 +6893,6 @@
@override
FormalParameterListImpl? get parameters => _parameters;
- @override
set parameters(FormalParameterList? parameters) {
_parameters = _becomeParentOf(parameters as FormalParameterListImpl?);
}
@@ -7004,7 +6900,6 @@
@override
TypeAnnotationImpl? get returnType => _returnType;
- @override
set returnType(TypeAnnotation? type) {
_returnType = _becomeParentOf(type as TypeAnnotationImpl?);
}
@@ -7012,7 +6907,6 @@
@override
TypeParameterListImpl? get typeParameters => _typeParameters;
- @override
set typeParameters(TypeParameterList? typeParameters) {
_typeParameters = _becomeParentOf(typeParameters as TypeParameterListImpl?);
}
@@ -7111,7 +7005,6 @@
@override
SimpleIdentifierImpl get methodName => _methodName;
- @override
set methodName(SimpleIdentifier identifier) {
_methodName = _becomeParentOf(identifier as SimpleIdentifierImpl);
}
@@ -7146,7 +7039,6 @@
@override
ExpressionImpl? get target => _target;
- @override
set target(Expression? expression) {
_target = _becomeParentOf(expression as ExpressionImpl?);
}
@@ -7241,12 +7133,6 @@
ImplementsClauseImpl? get implementsClause => _implementsClause;
@override
- set implementsClause(ImplementsClause? implementsClause) {
- _implementsClause =
- _becomeParentOf(implementsClause as ImplementsClauseImpl);
- }
-
- @override
NodeListImpl<ClassMember> get members => _members;
@override
@@ -7260,11 +7146,6 @@
TypeParameterListImpl? get typeParameters => _typeParameters;
@override
- set typeParameters(TypeParameterList? typeParameters) {
- _typeParameters = _becomeParentOf(typeParameters as TypeParameterListImpl?);
- }
-
- @override
E? accept<E>(AstVisitor<E> visitor) => visitor.visitMixinDeclaration(this);
@override
@@ -7296,7 +7177,6 @@
@override
SimpleIdentifierImpl get name => _name;
- @override
set name(SimpleIdentifier identifier) {
_name = _becomeParentOf(identifier as SimpleIdentifierImpl);
}
@@ -7342,7 +7222,6 @@
@override
ExpressionImpl get expression => _expression;
- @override
set expression(Expression expression) {
_expression = _becomeParentOf(expression as ExpressionImpl);
}
@@ -7350,7 +7229,6 @@
@override
LabelImpl get name => _name;
- @override
set name(Label identifier) {
_name = _becomeParentOf(identifier as LabelImpl);
}
@@ -7461,7 +7339,6 @@
@override
StringLiteralImpl? get name => _name;
- @override
set name(StringLiteral? name) {
_name = _becomeParentOf(name as StringLiteralImpl?);
}
@@ -7514,7 +7391,6 @@
@override
StringLiteralImpl? get stringLiteral => _stringLiteral;
- @override
set stringLiteral(StringLiteral? stringLiteral) {
_stringLiteral = _becomeParentOf(stringLiteral as StringLiteralImpl?);
}
@@ -7681,7 +7557,6 @@
@override
CommentImpl? get documentationComment => _comment;
- @override
set documentationComment(Comment? comment) {
_comment = _becomeParentOf(comment as CommentImpl?);
}
@@ -7689,7 +7564,6 @@
@override
SimpleIdentifierImpl? get identifier => _identifier;
- @override
set identifier(SimpleIdentifier? identifier) {
_identifier = _becomeParentOf(identifier as SimpleIdentifierImpl?);
}
@@ -7706,7 +7580,6 @@
@override
NodeListImpl<Annotation> get metadata => _metadata;
- @override
set metadata(List<Annotation> metadata) {
_metadata.clear();
_metadata.addAll(metadata);
@@ -7897,7 +7770,6 @@
@override
ExpressionImpl get expression => _expression;
- @override
set expression(Expression expression) {
_expression = _becomeParentOf(expression as ExpressionImpl);
}
@@ -8027,7 +7899,6 @@
@override
LibraryIdentifierImpl? get libraryName => _libraryName;
- @override
set libraryName(LibraryIdentifier? libraryName) {
_libraryName = _becomeParentOf(libraryName as LibraryIdentifierImpl?);
}
@@ -8035,7 +7906,6 @@
@override
StringLiteralImpl? get uri => _uri;
- @override
set uri(StringLiteral? uri) {
_uri = _becomeParentOf(uri as StringLiteralImpl?);
}
@@ -8089,7 +7959,6 @@
@override
ExpressionImpl get operand => _operand;
- @override
set operand(Expression expression) {
_operand = _becomeParentOf(expression as ExpressionImpl);
}
@@ -8163,7 +8032,6 @@
@override
SimpleIdentifierImpl get identifier => _identifier;
- @override
set identifier(SimpleIdentifier identifier) {
_identifier = _becomeParentOf(identifier as SimpleIdentifierImpl);
}
@@ -8191,7 +8059,6 @@
@override
SimpleIdentifierImpl get prefix => _prefix;
- @override
set prefix(SimpleIdentifier identifier) {
_prefix = _becomeParentOf(identifier as SimpleIdentifierImpl);
}
@@ -8249,7 +8116,6 @@
@override
ExpressionImpl get operand => _operand;
- @override
set operand(Expression expression) {
_operand = _becomeParentOf(expression as ExpressionImpl);
}
@@ -8353,7 +8219,6 @@
@override
SimpleIdentifierImpl get propertyName => _propertyName;
- @override
set propertyName(SimpleIdentifier identifier) {
_propertyName = _becomeParentOf(identifier as SimpleIdentifierImpl);
}
@@ -8369,7 +8234,6 @@
@override
ExpressionImpl? get target => _target;
- @override
set target(Expression? expression) {
_target = _becomeParentOf(expression as ExpressionImpl?);
}
@@ -8444,7 +8308,6 @@
@override
ArgumentListImpl get argumentList => _argumentList;
- @override
set argumentList(ArgumentList argumentList) {
_argumentList = _becomeParentOf(argumentList as ArgumentListImpl);
}
@@ -8462,7 +8325,6 @@
@override
SimpleIdentifierImpl? get constructorName => _constructorName;
- @override
set constructorName(SimpleIdentifier? identifier) {
_constructorName = _becomeParentOf(identifier as SimpleIdentifierImpl?);
}
@@ -8552,7 +8414,6 @@
@override
ExpressionImpl? get expression => _expression;
- @override
set expression(Expression? expression) {
_expression = _becomeParentOf(expression as ExpressionImpl?);
}
@@ -8800,7 +8661,6 @@
@override
TypeAnnotationImpl? get type => _type;
- @override
set type(TypeAnnotation? type) {
_type = _becomeParentOf(type as TypeAnnotationImpl?);
}
@@ -8906,7 +8766,6 @@
@override
Element? get staticElement => _staticElement;
- @override
set staticElement(Element? element) {
_staticElement = element;
}
@@ -9074,7 +8933,6 @@
@override
String get value => _value;
- @override
set value(String string) {
_value = StringUtilities.intern(_value);
}
@@ -9419,7 +9277,6 @@
@override
ArgumentListImpl get argumentList => _argumentList;
- @override
set argumentList(ArgumentList argumentList) {
_argumentList = _becomeParentOf(argumentList as ArgumentListImpl);
}
@@ -9437,7 +9294,6 @@
@override
SimpleIdentifierImpl? get constructorName => _constructorName;
- @override
set constructorName(SimpleIdentifier? identifier) {
_constructorName = _becomeParentOf(identifier as SimpleIdentifierImpl?);
}
@@ -9517,7 +9373,6 @@
@override
ExpressionImpl get expression => _expression;
- @override
set expression(Expression expression) {
_expression = _becomeParentOf(expression as ExpressionImpl);
}
@@ -9677,7 +9532,6 @@
@override
ExpressionImpl get expression => _expression;
- @override
set expression(Expression expression) {
_expression = _becomeParentOf(expression as ExpressionImpl);
}
@@ -9798,7 +9652,6 @@
@override
ExpressionImpl get expression => _expression;
- @override
set expression(Expression expression) {
_expression = _becomeParentOf(expression as ExpressionImpl);
}
@@ -9862,7 +9715,6 @@
@override
VariableDeclarationListImpl get variables => _variableList;
- @override
set variables(VariableDeclarationList variables) {
_variableList = _becomeParentOf(variables as VariableDeclarationListImpl);
}
@@ -9921,7 +9773,6 @@
@override
BlockImpl get body => _body;
- @override
set body(Block block) {
_body = _becomeParentOf(block as BlockImpl);
}
@@ -9952,7 +9803,6 @@
@override
Block? get finallyBlock => _finallyBlock;
- @override
set finallyBlock(Block? block) {
_finallyBlock = _becomeParentOf(block as BlockImpl?);
}
@@ -10085,7 +9935,6 @@
@override
TypeArgumentListImpl? get typeArguments => _typeArguments;
- @override
set typeArguments(TypeArgumentList? typeArguments) {
_typeArguments = _becomeParentOf(typeArguments as TypeArgumentListImpl?);
}
@@ -10198,7 +10047,6 @@
@override
IdentifierImpl get name => _name;
- @override
set name(Identifier identifier) {
_name = _becomeParentOf(identifier as IdentifierImpl);
}
@@ -10206,7 +10054,6 @@
@override
TypeArgumentListImpl? get typeArguments => _typeArguments;
- @override
set typeArguments(TypeArgumentList? typeArguments) {
_typeArguments = _becomeParentOf(typeArguments as TypeArgumentListImpl?);
}
@@ -10258,7 +10105,6 @@
@override
TypeAnnotationImpl? get bound => _bound;
- @override
set bound(TypeAnnotation? type) {
_bound = _becomeParentOf(type as TypeAnnotationImpl?);
}
@@ -10285,7 +10131,6 @@
@override
SimpleIdentifierImpl get name => _name;
- @override
set name(SimpleIdentifier identifier) {
_name = _becomeParentOf(identifier as SimpleIdentifierImpl);
}
@@ -10380,7 +10225,6 @@
@override
StringLiteralImpl get uri => _uri;
- @override
set uri(StringLiteral uri) {
_uri = _becomeParentOf(uri as StringLiteralImpl);
}
@@ -10519,7 +10363,6 @@
@override
ExpressionImpl? get initializer => _initializer;
- @override
set initializer(Expression? expression) {
_initializer = _becomeParentOf(expression as ExpressionImpl?);
}
@@ -10545,7 +10388,6 @@
@override
SimpleIdentifierImpl get name => _name;
- @override
set name(SimpleIdentifier identifier) {
_name = _becomeParentOf(identifier as SimpleIdentifierImpl);
}
@@ -10636,7 +10478,6 @@
@override
TypeAnnotationImpl? get type => _type;
- @override
set type(TypeAnnotation? type) {
_type = _becomeParentOf(type as TypeAnnotationImpl?);
}
@@ -10688,7 +10529,6 @@
@override
VariableDeclarationListImpl get variables => _variableList;
- @override
set variables(VariableDeclarationList variables) {
_variableList = _becomeParentOf(variables as VariableDeclarationListImpl);
}
@@ -10739,7 +10579,6 @@
@override
StatementImpl get body => _body;
- @override
set body(Statement statement) {
_body = _becomeParentOf(statement as StatementImpl);
}
@@ -10755,7 +10594,6 @@
@override
ExpressionImpl get condition => _condition;
- @override
set condition(Expression expression) {
_condition = _becomeParentOf(expression as ExpressionImpl);
}
@@ -10861,7 +10699,6 @@
@override
ExpressionImpl get expression => _expression;
- @override
set expression(Expression expression) {
_expression = _becomeParentOf(expression as ExpressionImpl);
}
diff --git a/pkg/analyzer/lib/src/dart/constant/constant_verifier.dart b/pkg/analyzer/lib/src/dart/constant/constant_verifier.dart
index cab832a..2b83639 100644
--- a/pkg/analyzer/lib/src/dart/constant/constant_verifier.dart
+++ b/pkg/analyzer/lib/src/dart/constant/constant_verifier.dart
@@ -802,14 +802,17 @@
}
if (listValue != null) {
- var elementType = value.type.typeArguments[0];
- if (verifier._implementsEqualsWhenNotAllowed(elementType)) {
- verifier._errorReporter.reportErrorForNode(
- CompileTimeErrorCode.CONST_SET_ELEMENT_TYPE_IMPLEMENTS_EQUALS,
- element,
- [elementType],
- );
- return false;
+ var type = value.type;
+ if (type is InterfaceType) {
+ var elementType = type.typeArguments[0];
+ if (verifier._implementsEqualsWhenNotAllowed(elementType)) {
+ verifier._errorReporter.reportErrorForNode(
+ CompileTimeErrorCode.CONST_SET_ELEMENT_TYPE_IMPLEMENTS_EQUALS,
+ element,
+ [elementType],
+ );
+ return false;
+ }
}
}
diff --git a/pkg/analyzer/lib/src/dart/constant/evaluation.dart b/pkg/analyzer/lib/src/dart/constant/evaluation.dart
index b644c74..b29a139 100644
--- a/pkg/analyzer/lib/src/dart/constant/evaluation.dart
+++ b/pkg/analyzer/lib/src/dart/constant/evaluation.dart
@@ -14,6 +14,7 @@
import 'package:analyzer/error/error.dart';
import 'package:analyzer/error/listener.dart';
import 'package:analyzer/src/dart/ast/ast_factory.dart';
+import 'package:analyzer/src/dart/ast/extensions.dart';
import 'package:analyzer/src/dart/constant/from_environment_evaluator.dart';
import 'package:analyzer/src/dart/constant/has_type_parameter_reference.dart';
import 'package:analyzer/src/dart/constant/potentially_constant.dart';
@@ -100,8 +101,7 @@
if (!(secondArgument.name.label.name == _DEFAULT_VALUE_PARAM)) {
return false;
}
- ParameterizedType defaultValueType =
- namedArgumentValues[_DEFAULT_VALUE_PARAM]!.type;
+ var defaultValueType = namedArgumentValues[_DEFAULT_VALUE_PARAM]!.type;
if (!(defaultValueType == expectedDefaultValueType ||
defaultValueType == library.typeProvider.nullType)) {
return false;
@@ -1597,10 +1597,9 @@
} else if (variableElement is ExecutableElement) {
var function = element as ExecutableElement;
if (function.isStatic) {
- var functionType = node.staticType as ParameterizedType;
return DartObjectImpl(
typeSystem,
- functionType,
+ node.typeOrThrow,
FunctionState(function),
);
}
diff --git a/pkg/analyzer/lib/src/dart/constant/value.dart b/pkg/analyzer/lib/src/dart/constant/value.dart
index 6bb7701..14aa28c 100644
--- a/pkg/analyzer/lib/src/dart/constant/value.dart
+++ b/pkg/analyzer/lib/src/dart/constant/value.dart
@@ -154,7 +154,7 @@
final TypeSystemImpl _typeSystem;
@override
- final ParameterizedType type;
+ final DartType type;
/// The state of the object.
final InstanceState _state;
diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart
index 4f7c6a5..2bdca7a 100644
--- a/pkg/analyzer/lib/src/dart/element/element.dart
+++ b/pkg/analyzer/lib/src/dart/element/element.dart
@@ -962,12 +962,6 @@
/// A list containing all of the mixins contained in this compilation unit.
List<ClassElement> _mixins = const [];
- /// A list containing all of the function type aliases contained in this
- /// compilation unit.
- @Deprecated('Use typeAliases instead')
- List<FunctionTypeAliasElement> _functionTypeAliases =
- _Sentinel.functionTypeAliasElement;
-
/// A list containing all of the type aliases contained in this compilation
/// unit.
List<TypeAliasElement> _typeAliases = const [];
@@ -1064,16 +1058,6 @@
_functions = functions;
}
- @Deprecated('Use typeAliases instead')
- @override
- List<FunctionTypeAliasElement> get functionTypeAliases {
- if (!identical(_functionTypeAliases, _Sentinel.functionTypeAliasElement)) {
- return _functionTypeAliases;
- }
- return _functionTypeAliases =
- typeAliases.whereType<FunctionTypeAliasElement>().toList();
- }
-
@override
int get hashCode => source.hashCode;
@@ -2962,7 +2946,6 @@
parameters: parameters,
returnType: returnType,
nullabilitySuffix: _noneOrStarSuffix,
- element: this,
);
}
@@ -3333,42 +3316,6 @@
T? accept<T>(ElementVisitor<T> visitor) => visitor.visitFunctionElement(this);
}
-@Deprecated('Use TypeAliasElement instead')
-class FunctionTypeAliasElementImpl extends TypeAliasElementImpl
- implements FunctionTypeAliasElement {
- FunctionTypeAliasElementImpl(String name, int nameOffset)
- : super(name, nameOffset);
-
- @Deprecated('Use aliasedElement instead')
- @override
- GenericFunctionTypeElementImpl get function {
- return aliasedElement as GenericFunctionTypeElementImpl;
- }
-
- @override
- T? accept<T>(ElementVisitor<T> visitor) {
- visitor.visitFunctionTypeAliasElement(this);
- return visitor.visitTypeAliasElement(this);
- }
-
- @Deprecated('Use TypeAliasElement instead')
- @override
- FunctionType instantiate({
- required List<DartType> typeArguments,
- required NullabilitySuffix nullabilitySuffix,
- }) {
- var type = super.instantiate(
- typeArguments: typeArguments,
- nullabilitySuffix: nullabilitySuffix,
- );
- if (type is FunctionType) {
- return type;
- } else {
- return _errorFunctionType(nullabilitySuffix);
- }
- }
-}
-
/// Common internal interface shared by elements whose type is a function type.
///
/// Clients may not extend, implement or mix-in this class.
@@ -5090,7 +5037,6 @@
parameters: const <ParameterElement>[],
returnType: returnType,
nullabilitySuffix: _noneOrStarSuffix,
- element: this,
);
}
}
@@ -5157,7 +5103,6 @@
parameters: parameters,
returnType: returnType,
nullabilitySuffix: _noneOrStarSuffix,
- element: this,
);
}
}
@@ -5818,9 +5763,6 @@
List.unmodifiable([]);
static final List<ExportElement> exportElement = List.unmodifiable([]);
static final List<FieldElement> fieldElement = List.unmodifiable([]);
- @Deprecated('Use TypeAliasElement instead')
- static final List<FunctionTypeAliasElement> functionTypeAliasElement =
- List.unmodifiable([]);
static final List<ImportElement> importElement = List.unmodifiable([]);
static final List<MethodElement> methodElement = List.unmodifiable([]);
static final List<PropertyAccessorElement> propertyAccessorElement =
diff --git a/pkg/analyzer/lib/src/dart/element/scope.dart b/pkg/analyzer/lib/src/dart/element/scope.dart
index 5f6ff73..1f15606 100644
--- a/pkg/analyzer/lib/src/dart/element/scope.dart
+++ b/pkg/analyzer/lib/src/dart/element/scope.dart
@@ -45,12 +45,6 @@
return _parent.lookup(id);
}
- @Deprecated('Use lookup() instead')
- @override
- ScopeLookupResult lookup2(String id) {
- return lookup(id);
- }
-
void _addGetter(Element element) {
_addTo(_getters, element);
}
@@ -199,12 +193,6 @@
return ScopeLookupResult(getter, setter);
}
- @Deprecated('Use lookup() instead')
- @override
- ScopeLookupResult lookup2(String id) {
- return lookup(id);
- }
-
void _add(Element element) {
if (element is PropertyAccessorElement && element.isSetter) {
_addTo(map: _setters, element: element);
@@ -306,10 +294,4 @@
ScopeLookupResult lookup(String id) {
return _nullPrefixScope.lookup(id);
}
-
- @Deprecated('Use lookup() instead')
- @override
- ScopeLookupResult lookup2(String id) {
- return lookup(id);
- }
}
diff --git a/pkg/analyzer/lib/src/dart/element/type.dart b/pkg/analyzer/lib/src/dart/element/type.dart
index 30d4a2c..a123137 100644
--- a/pkg/analyzer/lib/src/dart/element/type.dart
+++ b/pkg/analyzer/lib/src/dart/element/type.dart
@@ -109,33 +109,13 @@
required List<ParameterElement> parameters,
required DartType returnType,
required NullabilitySuffix nullabilitySuffix,
- Element? element,
TypeAliasElement? aliasElement,
List<DartType>? aliasArguments,
}) : typeFormals = typeFormals,
parameters = _sortNamedParameters(parameters),
returnType = returnType,
nullabilitySuffix = nullabilitySuffix,
- super(element,
- aliasElement: aliasElement, aliasArguments: aliasArguments);
-
- @Deprecated('Use aliasElement instead')
- @override
- FunctionTypedElement? get element {
- // TODO(scheglov) https://github.com/dart-lang/sdk/issues/44629
- // TODO(scheglov) Can we just construct it with the right element?
- var aliasedElement = aliasElement?.aliasedElement;
- if (aliasedElement is GenericFunctionTypeElement) {
- return aliasedElement;
- }
-
- var element = super.element;
- if (element is FunctionTypedElement) {
- return element;
- }
-
- return null;
- }
+ super(null, aliasElement: aliasElement, aliasArguments: aliasArguments);
@override
int get hashCode {
@@ -206,13 +186,6 @@
return types;
}
- @Deprecated('Use aliasArguments instead')
- @override
- List<DartType> get typeArguments {
- // TODO(scheglov) https://github.com/dart-lang/sdk/issues/44629
- return aliasArguments ?? const <DartType>[];
- }
-
@override
bool operator ==(Object other) {
if (identical(other, this)) {
diff --git a/pkg/analyzer/lib/src/dart/error/ffi_code.dart b/pkg/analyzer/lib/src/dart/error/ffi_code.dart
index 83141a8..639a3f3 100644
--- a/pkg/analyzer/lib/src/dart/error/ffi_code.dart
+++ b/pkg/analyzer/lib/src/dart/error/ffi_code.dart
@@ -88,6 +88,15 @@
" external.");
/**
+ * No parameters.
+ */
+ static const FfiCode FIELD_MUST_BE_EXTERNAL_IN_STRUCT = FfiCode(
+ name: 'FIELD_MUST_BE_EXTERNAL_IN_STRUCT',
+ message:
+ "Fields of 'Struct' and 'Union' subclasses must be marked external.",
+ correction: "Try adding the 'external' modifier.");
+
+ /**
* Parameters:
* 0: the name of the struct class
*/
diff --git a/pkg/analyzer/lib/src/dart/micro/analysis_context.dart b/pkg/analyzer/lib/src/dart/micro/analysis_context.dart
index f118bed..4d79d83 100644
--- a/pkg/analyzer/lib/src/dart/micro/analysis_context.dart
+++ b/pkg/analyzer/lib/src/dart/micro/analysis_context.dart
@@ -19,7 +19,6 @@
import 'package:analyzer/src/dart/micro/resolve_file.dart';
import 'package:analyzer/src/generated/engine.dart' show AnalysisOptionsImpl;
import 'package:analyzer/src/generated/source.dart';
-import 'package:analyzer/src/util/performance/operation_performance.dart';
import 'package:analyzer/src/workspace/workspace.dart';
MicroContextObjects createMicroContextObjects({
@@ -182,21 +181,6 @@
}
@override
- FileResult getFile(String path) {
- var fileContext = analysisContext.fileResolver.getFileContext(
- path: path,
- performance: OperationPerformanceImpl('<default>'),
- );
- return FileResultImpl(
- this,
- path,
- fileContext.file.uri,
- fileContext.file.lineInfo,
- false,
- );
- }
-
- @override
Future<SomeLibraryElementResult> getLibraryByUri2(String uriStr) async {
var element = analysisContext.fileResolver.getLibraryByUri(uriStr: uriStr);
return LibraryElementResultImpl(element);
diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart
index 7d6e8ab..b4880fb 100644
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
@@ -310,6 +310,15 @@
superClass.name == 'Struct';
}
+ /// The language team is thinking about adding abstract fields, or external
+ /// fields. But for now we will ignore such fields in `Struct` subtypes.
+ bool get _isEnclosingClassFfiUnion {
+ var superClass = _enclosingClass?.supertype?.element;
+ return superClass != null &&
+ superClass.library.name == 'dart.ffi' &&
+ superClass.name == 'Union';
+ }
+
bool get _isNonNullableByDefault =>
_featureSet?.isEnabled(Feature.non_nullable) ?? false;
@@ -3423,6 +3432,7 @@
if (fields.isFinal) return;
if (_isEnclosingClassFfiStruct) return;
+ if (_isEnclosingClassFfiUnion) return;
for (var field in fields.variables) {
var fieldElement = field.declaredElement as FieldElement;
diff --git a/pkg/analyzer/lib/src/generated/ffi_verifier.dart b/pkg/analyzer/lib/src/generated/ffi_verifier.dart
index 4dbed55..a71cbce 100644
--- a/pkg/analyzer/lib/src/generated/ffi_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/ffi_verifier.dart
@@ -137,9 +137,11 @@
@override
void visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
- if (inCompound) {
+ if (!typeSystem.isNonNullableByDefault && inCompound) {
_errorReporter.reportErrorForNode(
- FfiCode.FIELD_INITIALIZER_IN_STRUCT, node);
+ FfiCode.FIELD_INITIALIZER_IN_STRUCT,
+ node,
+ );
}
super.visitConstructorFieldInitializer(node);
}
@@ -626,8 +628,19 @@
if (node.isStatic) {
return;
}
+
VariableDeclarationList fields = node.fields;
NodeList<Annotation> annotations = node.metadata;
+
+ if (typeSystem.isNonNullableByDefault) {
+ if (node.externalKeyword == null) {
+ _errorReporter.reportErrorForNode(
+ FfiCode.FIELD_MUST_BE_EXTERNAL_IN_STRUCT,
+ fields.variables[0].name,
+ );
+ }
+ }
+
var fieldType = fields.type;
if (fieldType == null) {
_errorReporter.reportErrorForNode(
@@ -667,10 +680,15 @@
fieldType, [fieldType.toSource()]);
}
}
- for (VariableDeclaration field in fields.variables) {
- if (field.initializer != null) {
- _errorReporter.reportErrorForNode(
- FfiCode.FIELD_IN_STRUCT_WITH_INITIALIZER, field.name);
+
+ if (!typeSystem.isNonNullableByDefault) {
+ for (VariableDeclaration field in fields.variables) {
+ if (field.initializer != null) {
+ _errorReporter.reportErrorForNode(
+ FfiCode.FIELD_IN_STRUCT_WITH_INITIALIZER,
+ field.name,
+ );
+ }
}
}
}
diff --git a/pkg/analyzer/lib/src/generated/source.dart b/pkg/analyzer/lib/src/generated/source.dart
index e08044c..2203d3d 100644
--- a/pkg/analyzer/lib/src/generated/source.dart
+++ b/pkg/analyzer/lib/src/generated/source.dart
@@ -92,24 +92,6 @@
static bool isDartUri(Uri uri) => DART_SCHEME == uri.scheme;
}
-/// Instances of the class `Location` represent the location of a character as a
-/// line and column pair.
-@deprecated
-class LineInfo_Location {
- /// The one-based index of the line containing the character.
- final int lineNumber;
-
- /// The one-based index of the column containing the character.
- final int columnNumber;
-
- /// Initialize a newly created location to represent the location of the
- /// character at the given [lineNumber] and [columnNumber].
- LineInfo_Location(this.lineNumber, this.columnNumber);
-
- @override
- String toString() => '$lineNumber:$columnNumber';
-}
-
/// An implementation of an non-existing [Source].
class NonExistingSource extends Source {
static final unknown = NonExistingSource(
diff --git a/pkg/analyzer/lib/src/summary2/bundle_reader.dart b/pkg/analyzer/lib/src/summary2/bundle_reader.dart
index b21dfaa..cccbbb3 100644
--- a/pkg/analyzer/lib/src/summary2/bundle_reader.dart
+++ b/pkg/analyzer/lib/src/summary2/bundle_reader.dart
@@ -1135,9 +1135,8 @@
TypeAliasElementImpl element;
if (isFunctionTypeAliasBased) {
- element =
- // ignore: deprecated_member_use_from_same_package
- FunctionTypeAliasElementImpl(name, -1);
+ element = TypeAliasElementImpl(name, -1);
+ element.isFunctionTypeAliasBased = true;
} else {
element = TypeAliasElementImpl(name, -1);
}
diff --git a/pkg/analyzer/lib/src/summary2/element_builder.dart b/pkg/analyzer/lib/src/summary2/element_builder.dart
index 396b8f7..3737f6e 100644
--- a/pkg/analyzer/lib/src/summary2/element_builder.dart
+++ b/pkg/analyzer/lib/src/summary2/element_builder.dart
@@ -2,7 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import 'package:analyzer/dart/analysis/features.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/ast/visitor.dart';
import 'package:analyzer/dart/element/element.dart';
@@ -39,12 +38,6 @@
_unitElement = unitElement,
_enclosingContext = _EnclosingContext(unitReference, unitElement);
- bool get _isNonFunctionTypeAliasesEnabled {
- return _libraryElement.featureSet.isEnabled(
- Feature.nonfunction_type_aliases,
- );
- }
-
LibraryElementImpl get _libraryElement => _libraryBuilder.element;
Linker get _linker => _libraryBuilder.linker;
@@ -448,8 +441,7 @@
var nameNode = node.name;
var name = nameNode.name;
- // ignore: deprecated_member_use_from_same_package
- var element = FunctionTypeAliasElementImpl(name, nameNode.offset);
+ var element = TypeAliasElementImpl(name, nameNode.offset);
element.isFunctionTypeAliasBased = true;
element.metadata = _buildAnnotations(node.metadata);
_setCodeRange(element, node);
@@ -552,15 +544,7 @@
var nameNode = node.name;
var name = nameNode.name;
- TypeAliasElementImpl element;
- var aliasedType = node.type;
- if (aliasedType is GenericFunctionType ||
- !_isNonFunctionTypeAliasesEnabled) {
- // ignore: deprecated_member_use_from_same_package
- element = FunctionTypeAliasElementImpl(name, nameNode.offset);
- } else {
- element = TypeAliasElementImpl(name, nameNode.offset);
- }
+ var element = TypeAliasElementImpl(name, nameNode.offset);
element.metadata = _buildAnnotations(node.metadata);
_setCodeRange(element, node);
_setDocumentation(element, node);
diff --git a/pkg/analyzer/pubspec.yaml b/pkg/analyzer/pubspec.yaml
index b3cbff8..8d9ff79 100644
--- a/pkg/analyzer/pubspec.yaml
+++ b/pkg/analyzer/pubspec.yaml
@@ -1,5 +1,5 @@
name: analyzer
-version: 1.8.0-dev
+version: 2.0.0-dev
description: This package provides a library that performs static analysis of Dart code.
homepage: https://github.com/dart-lang/sdk/tree/master/pkg/analyzer
diff --git a/pkg/analyzer/test/generated/non_error_resolver_test.dart b/pkg/analyzer/test/generated/non_error_resolver_test.dart
index ba86bc2..33fc9a1 100644
--- a/pkg/analyzer/test/generated/non_error_resolver_test.dart
+++ b/pkg/analyzer/test/generated/non_error_resolver_test.dart
@@ -2816,13 +2816,9 @@
if (!unbounded.isNull) {
expect(bounded.isNull, true);
assertType(unbounded.type, 'Unbounded<dynamic>');
- expect(unbounded.type!.typeArguments, hasLength(1));
- expect(unbounded.type!.typeArguments[0].isDynamic, isTrue);
} else {
expect(unbounded.isNull, true);
assertType(bounded.type, 'Bounded<String>');
- expect(bounded.type!.typeArguments, hasLength(1));
- assertType(bounded.type!.typeArguments[0], 'String');
}
});
}
diff --git a/pkg/analyzer/test/generated/scanner_test.dart b/pkg/analyzer/test/generated/scanner_test.dart
index dab2ec5..ed20e1a 100644
--- a/pkg/analyzer/test/generated/scanner_test.dart
+++ b/pkg/analyzer/test/generated/scanner_test.dart
@@ -174,8 +174,7 @@
int count = expectedLocations.length;
for (int i = 0; i < count; i++) {
ScannerTest_ExpectedLocation expectedLocation = expectedLocations[i];
- var location =
- info.getLocation(expectedLocation._offset) as CharacterLocation;
+ var location = info.getLocation(expectedLocation._offset);
expect(location.lineNumber, expectedLocation._lineNumber,
reason: 'Line number in location $i');
expect(location.columnNumber, expectedLocation._columnNumber,
diff --git a/pkg/analyzer/test/src/dart/analysis/driver_test.dart b/pkg/analyzer/test/src/dart/analysis/driver_test.dart
index b725881..a970cf4 100644
--- a/pkg/analyzer/test/src/dart/analysis/driver_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/driver_test.dart
@@ -1085,63 +1085,6 @@
expect(errors[0].errorCode, CompileTimeErrorCode.URI_DOES_NOT_EXIST);
}
- @deprecated
- test_generatedFile() async {
- Uri uri = Uri.parse('package:aaa/foo.dart');
- String templatePath = convertPath('/aaa/lib/foo.dart');
- String generatedPath = convertPath('/generated/aaa/lib/foo.dart');
-
- newFile(templatePath, content: r'''
-a() {}
-b() {}
-''');
-
- newFile(generatedPath, content: r'''
-aaa() {}
-bbb() {}
-''');
-
- Source generatedSource = _SourceMock(generatedPath, uri);
-
- generatedUriResolver.resolveAbsoluteFunction = (uri) => generatedSource;
- generatedUriResolver.restoreAbsoluteFunction = (Source source) {
- String path = source.fullName;
- if (path == templatePath || path == generatedPath) {
- return uri;
- } else {
- return null;
- }
- };
-
- driver.addFile(templatePath);
-
- await waitForIdleWithoutExceptions();
- expect(allExceptions, isEmpty);
- expect(allResults, isEmpty);
-
- {
- var result = await driver.getResult(templatePath);
- expect(result.state, ResultState.NOT_FILE_OF_URI);
- expect(allExceptions, isEmpty);
- expect(allResults, isEmpty);
- }
-
- {
- var result = await driver.getUnitElement(templatePath);
- expect(result.state, ResultState.NOT_FILE_OF_URI);
- expect(allExceptions, isEmpty);
- expect(allResults, isEmpty);
- }
-
- driver.priorityFiles = [templatePath];
- driver.changeFile(templatePath);
- await waitForIdleWithoutExceptions();
- expect(allExceptions, isEmpty);
- expect(allResults, isEmpty);
-
- expect(driver.knownFiles, isNot(contains(templatePath)));
- }
-
test_generatedFile2() async {
Uri uri = Uri.parse('package:aaa/foo.dart');
String templatePath = convertPath('/aaa/lib/foo.dart');
@@ -1217,17 +1160,6 @@
expect(driver.getCachedResult(a), same(result));
}
- @deprecated
- test_getErrors() async {
- String content = 'int f() => 42 + bar();';
- addTestFile(content, priority: true);
-
- var result = await driver.getErrors(testFile);
- expect(result.path, testFile);
- expect(result.uri.toString(), 'package:test/test.dart');
- expect(result.errors, hasLength(1));
- }
-
test_getErrors2() async {
String content = 'int f() => 42 + bar();';
addTestFile(content, priority: true);
@@ -1243,13 +1175,6 @@
expect(result, isA<InvalidPathResult>());
}
- @deprecated
- test_getErrors_notAbsolutePath() async {
- expect(() async {
- await driver.getErrors('not_absolute.dart');
- }, throwsArgumentError);
- }
-
test_getFilesDefiningClassMemberName_class() async {
var a = convertPath('/test/bin/a.dart');
var b = convertPath('/test/bin/b.dart');
@@ -1413,71 +1338,6 @@
expect(file.isPart, isTrue);
}
- @deprecated
- test_getFileSync_changedFile() async {
- var a = convertPath('/test/lib/a.dart');
- var b = convertPath('/test/lib/b.dart');
-
- newFile(a, content: '');
- newFile(b, content: r'''
-import 'a.dart';
-
-void f(A a) {}
-''');
-
- // Ensure that [a.dart] library cycle is loaded.
- // So, `a.dart` is in the library context.
- await driver.getResultValid(a);
-
- // Update the file, changing its API signature.
- // Note that we don't call `changeFile`.
- newFile(a, content: 'class A {}\n');
-
- // Get the file.
- // We have not called `changeFile(a)`, so we should not read the file.
- // Moreover, doing this will create a new library cycle [a.dart].
- // Library cycles are compared by their identity, so we would try to
- // reload linked summary for [a.dart], and crash.
- expect(driver.getFileSync(a).lineInfo.lineCount, 1);
-
- // We have not read `a.dart`, so `A` is still not declared.
- expect((await driver.getResultValid(b)).errors, isNotEmpty);
-
- // Notify the driver that the file was changed.
- driver.changeFile(a);
-
- // So, `class A {}` is declared now.
- expect(driver.getFileSync(a).lineInfo.lineCount, 2);
- expect((await driver.getResultValid(b)).errors, isEmpty);
- }
-
- @deprecated
- test_getFileSync_library() async {
- var path = convertPath('/test/lib/a.dart');
- newFile(path);
- var file = driver.getFileSync(path);
- expect(file.path, path);
- expect(file.uri.toString(), 'package:test/a.dart');
- expect(file.isPart, isFalse);
- }
-
- @deprecated
- test_getFileSync_notAbsolutePath() async {
- expect(() {
- driver.getFileSync('not_absolute.dart');
- }, throwsArgumentError);
- }
-
- @deprecated
- test_getFileSync_part() async {
- var path = convertPath('/test/lib/a.dart');
- newFile(path, content: 'part of lib;');
- var file = driver.getFileSync(path);
- expect(file.path, path);
- expect(file.uri.toString(), 'package:test/a.dart');
- expect(file.isPart, isTrue);
- }
-
test_getIndex() async {
String content = r'''
foo(int p) {}
@@ -1501,36 +1361,6 @@
}, throwsArgumentError);
}
- @deprecated
- test_getLibraryByUri() async {
- var a = '/test/lib/a.dart';
- var b = '/test/lib/b.dart';
-
- String aUriStr = 'package:test/a.dart';
- String bUriStr = 'package:test/b.dart';
-
- newFile(a, content: r'''
-part 'b.dart';
-
-class A {}
-''');
-
- newFile(b, content: r'''
-part of 'a.dart';
-
-class B {}
-''');
-
- var library = await driver.getLibraryByUri(aUriStr);
- expect(library.getType('A'), isNotNull);
- expect(library.getType('B'), isNotNull);
-
- // It is an error to ask for a library when we know that it is a part.
- expect(() async {
- await driver.getLibraryByUri(bUriStr);
- }, throwsArgumentError);
- }
-
test_getLibraryByUri2() async {
var a = '/test/lib/a.dart';
var b = '/test/lib/b.dart';
@@ -1567,13 +1397,6 @@
expect(result, isA<CannotResolveUriResult>());
}
- @deprecated
- test_getLibraryByUri_unresolvedUri() async {
- expect(() async {
- await driver.getLibraryByUri('package:foo/foo.dart');
- }, throwsArgumentError);
- }
-
test_getParsedLibrary2() async {
var content = 'class A {}';
addTestFile(content);
@@ -2019,13 +1842,6 @@
await driver.getResultValid(testFile);
}
- @deprecated
- test_getResult_notAbsolutePath() async {
- expect(() async {
- await driver.getResult('not_absolute.dart');
- }, throwsArgumentError);
- }
-
test_getResult_notDartFile() async {
var path = convertPath('/test/lib/test.txt');
newFile(path, content: 'class A {}');
@@ -2150,109 +1966,6 @@
expect(result1.unit, isNotNull);
}
- @deprecated
- test_getSourceKind_changedFile() async {
- var a = convertPath('/test/lib/a.dart');
- var b = convertPath('/test/lib/b.dart');
-
- newFile(a, content: 'part of lib;');
- newFile(b, content: r'''
-import 'a.dart';
-
-void f(A a) {}
-''');
-
- // Ensure that [a.dart] library cycle is loaded.
- // So, `a.dart` is in the library context.
- await driver.getResultValid(a);
-
- // Update the file, changing its API signature.
- // Note that we don't call `changeFile`.
- newFile(a, content: 'class A {}');
-
- // Get the kind of the file.
- // We have not called `changeFile(a)`, so we should not read the file.
- // Moreover, doing this will create a new library cycle [a.dart].
- // Library cycles are compared by their identity, so we would try to
- // reload linked summary for [a.dart], and crash.
- expect(await driver.getSourceKind(a), SourceKind.PART);
-
- // We have not read `a.dart`, so `A` is still not declared.
- expect((await driver.getResultValid(b)).errors, isNotEmpty);
-
- // Notify the driver that the file was changed.
- driver.changeFile(a);
-
- // So, `class A {}` is declared now.
- expect(await driver.getSourceKind(a), SourceKind.LIBRARY);
- expect((await driver.getResultValid(b)).errors, isEmpty);
- }
-
- @deprecated
- test_getSourceKind_changeFile() async {
- var path = convertPath('/test/lib/test.dart');
- expect(await driver.getSourceKind(path), SourceKind.LIBRARY);
-
- newFile(path, content: 'part of foo;');
- driver.changeFile(path);
- expect(await driver.getSourceKind(path), SourceKind.PART);
-
- newFile(path, content: '');
- driver.changeFile(path);
- expect(await driver.getSourceKind(path), SourceKind.LIBRARY);
- }
-
- @deprecated
- test_getSourceKind_doesNotExist() async {
- var path = convertPath('/test/lib/test.dart');
- expect(await driver.getSourceKind(path), SourceKind.LIBRARY);
- }
-
- @deprecated
- test_getSourceKind_library() async {
- var path = convertPath('/test/lib/test.dart');
- newFile(path, content: 'class A {}');
- expect(await driver.getSourceKind(path), SourceKind.LIBRARY);
- }
-
- @deprecated
- test_getSourceKind_notAbsolutePath() async {
- expect(() async {
- await driver.getSourceKind('not_absolute.dart');
- }, throwsArgumentError);
- }
-
- @deprecated
- test_getSourceKind_notDartFile() async {
- var path = convertPath('/test/lib/test.txt');
- newFile(path, content: 'class A {}');
- expect(await driver.getSourceKind(path), isNull);
- }
-
- @deprecated
- test_getSourceKind_part() async {
- var path = convertPath('/test/lib/test.dart');
- newFile(path, content: 'part of lib; class A {}');
- expect(await driver.getSourceKind(path), SourceKind.PART);
- }
-
- @deprecated
- test_getUnitElement() async {
- String content = r'''
-foo(int p) {}
-main() {
- foo(42);
-}
-''';
- addTestFile(content);
-
- UnitElementResult unitResult = await driver.getUnitElement(testFile);
- CompilationUnitElement unitElement = unitResult.element;
- expect(unitElement.source.fullName, testFile);
- expect(unitElement.functions.map((c) => c.name),
- unorderedEquals(['foo', 'main']));
- }
-
test_getUnitElement2() async {
String content = r'''
foo(int p) {}
@@ -2295,55 +2008,6 @@
expect(unitResult.element.classes.map((e) => e.name), ['A']);
}
- @deprecated
- test_getUnitElement_doesNotExist_afterResynthesized() async {
- var a = convertPath('/test/lib/a.dart');
- var b = convertPath('/test/lib/b.dart');
-
- newFile(a, content: r'''
-import 'package:test/b.dart';
-''');
-
- await driver.getResolvedLibrary(a);
- await driver.getUnitElement(b);
- }
-
- @deprecated
- test_getUnitElement_notAbsolutePath() async {
- expect(() async {
- await driver.getUnitElement('not_absolute.dart');
- }, throwsArgumentError);
- }
-
- @deprecated
- test_getUnitElement_notDart() async {
- var path = convertPath('/test.txt');
- newFile(path, content: 'class A {}');
- UnitElementResult unitResult = await driver.getUnitElement(path);
- expect(unitResult.element.types.map((e) => e.name), ['A']);
- }
-
- @deprecated
- test_getUnitElementSignature() async {
- var a = convertPath('/test/lib/a.dart');
-
- newFile(a, content: 'foo() {}');
-
- String signature = await driver.getUnitElementSignature(a);
- expect(signature, isNotNull);
-
- UnitElementResult unitResult = await driver.getUnitElement(a);
- expect(unitResult.path, a);
- expect(unitResult.signature, signature);
-
- modifyFile(a, 'bar() {}');
- driver.changeFile(a);
-
- String signature2 = await driver.getUnitElementSignature(a);
- expect(signature2, isNotNull);
- expect(signature2, isNot(signature));
- }
-
test_hasFilesToAnalyze() async {
// No files yet, nothing to analyze.
expect(driver.hasFilesToAnalyze, isFalse);
@@ -2622,73 +2286,6 @@
expect(driver.knownFiles, contains(p));
}
- @deprecated
- test_parseFile_changedFile() async {
- var a = convertPath('/test/lib/a.dart');
- var b = convertPath('/test/lib/b.dart');
-
- newFile(a, content: '');
- newFile(b, content: r'''
-import 'a.dart';
-
-void f(A a) {}
-''');
-
- // Ensure that [a.dart] library cycle is loaded.
- // So, `a.dart` is in the library context.
- await driver.getResultValid(a);
-
- // Update the file, changing its API signature.
- // Note that we don't call `changeFile`.
- newFile(a, content: 'class A {}');
-
- // Parse the file.
- // We have not called `changeFile(a)`, so we should not read the file.
- // Moreover, doing this will create a new library cycle [a.dart].
- // Library cycles are compared by their identity, so we would try to
- // reload linked summary for [a.dart], and crash.
- {
- var parseResult = await driver.parseFile(a);
- expect(parseResult.unit.declarations, isEmpty);
- }
-
- // We have not read `a.dart`, so `A` is still not declared.
- {
- var bResult = await driver.getResultValid(b);
- expect(bResult.errors, isNotEmpty);
- }
-
- // Notify the driver that the file was changed.
- driver.changeFile(a);
-
- // So, `class A {}` is declared now.
- {
- var parseResult = driver.parseFileSync(a);
- expect(parseResult.unit.declarations, hasLength(1));
- }
- {
- var bResult = await driver.getResultValid(b);
- expect(bResult.errors, isEmpty);
- }
- }
-
- @deprecated
- test_parseFile_notAbsolutePath() async {
- expect(() async {
- await driver.parseFile('not_absolute.dart');
- }, throwsArgumentError);
- }
-
- @deprecated
- test_parseFile_notDart() async {
- var p = convertPath('/test/bin/a.txt');
- newFile(p, content: 'class A {}');
-
- ParsedUnitResult parseResult = await driver.parseFile(p);
- expect(parseResult, isNotNull);
- expect(driver.knownFiles, contains(p));
- }
-
test_parseFileSync2_changedFile() async {
var a = convertPath('/test/lib/a.dart');
var b = convertPath('/test/lib/b.dart');
@@ -2820,145 +2417,6 @@
expect(driver.knownFiles, contains(p));
}
- @deprecated
- test_parseFileSync_changedFile() async {
- var a = convertPath('/test/lib/a.dart');
- var b = convertPath('/test/lib/b.dart');
-
- newFile(a, content: '');
- newFile(b, content: r'''
-import 'a.dart';
-
-void f(A a) {}
-''');
-
- // Ensure that [a.dart] library cycle is loaded.
- // So, `a.dart` is in the library context.
- await driver.getResultValid(a);
-
- // Update the file, changing its API signature.
- // Note that we don't call `changeFile`.
- newFile(a, content: 'class A {}');
-
- // Parse the file.
- // We have not called `changeFile(a)`, so we should not read the file.
- // Moreover, doing this will create a new library cycle [a.dart].
- // Library cycles are compared by their identity, so we would try to
- // reload linked summary for [a.dart], and crash.
- {
- var parseResult = driver.parseFileSync(a);
- expect(parseResult.unit.declarations, isEmpty);
- }
-
- // We have not read `a.dart`, so `A` is still not declared.
- {
- var bResult = await driver.getResultValid(b);
- expect(bResult.errors, isNotEmpty);
- }
-
- // Notify the driver that the file was changed.
- driver.changeFile(a);
-
- // So, `class A {}` is declared now.
- {
- var parseResult = driver.parseFileSync(a);
- expect(parseResult.unit.declarations, hasLength(1));
- }
- {
- var bResult = await driver.getResultValid(b);
- expect(bResult.errors, isEmpty);
- }
- }
-
- @deprecated
- test_parseFileSync_doesNotReadImportedFiles() async {
- var a = convertPath('/test/lib/a.dart');
- var b = convertPath('/test/lib/b.dart');
-
- newFile(a, content: '');
- newFile(b, content: r'''
-import 'a.dart';
-''');
-
- expect(driver.fsState.knownFilePaths, isEmpty);
-
- // Don't read `a.dart` when parse.
- driver.parseFileSync(b);
- expect(driver.fsState.knownFilePaths, unorderedEquals([b]));
-
- // Still don't read `a.dart` when parse the second time.
- driver.parseFileSync(b);
- expect(driver.fsState.knownFilePaths, unorderedEquals([b]));
- }
-
- @deprecated
- test_parseFileSync_doesNotReadPartedFiles() async {
- var a = convertPath('/test/lib/a.dart');
- var b = convertPath('/test/lib/b.dart');
-
- newFile(a, content: r'''
-part of my;
-''');
- newFile(b, content: r'''
-library my;
-part 'a.dart';
-''');
-
- expect(driver.fsState.knownFilePaths, isEmpty);
-
- // Don't read `a.dart` when parse.
- driver.parseFileSync(b);
- expect(driver.fsState.knownFilePaths, unorderedEquals([b]));
-
- // Still don't read `a.dart` when parse the second time.
- driver.parseFileSync(b);
- expect(driver.fsState.knownFilePaths, unorderedEquals([b]));
- }
-
- @deprecated
- test_parseFileSync_languageVersion() async {
- var path = convertPath('/test/lib/test.dart');
-
- newFile(path, content: r'''
-// @dart = 2.7
-class A {}
-''');
-
- var parseResult = driver.parseFileSync(path);
- var languageVersion = parseResult.unit.languageVersionToken!;
- expect(languageVersion.major, 2);
- expect(languageVersion.minor, 7);
- }
-
- @deprecated
- test_parseFileSync_languageVersion_null() async {
- var path = convertPath('/test/lib/test.dart');
-
- newFile(path, content: r'''
-class A {}
-''');
-
- var parseResult = driver.parseFileSync(path);
- expect(parseResult.unit.languageVersionToken, isNull);
- }
-
- @deprecated
- test_parseFileSync_notAbsolutePath() {
- expect(() {
- driver.parseFileSync('not_absolute.dart');
- }, throwsArgumentError);
- }
-
- @deprecated
- test_parseFileSync_notDart() {
- var p = convertPath('/test/bin/a.txt');
- newFile(p, content: 'class A {}');
-
- ParsedUnitResult parseResult = driver.parseFileSync(p);
- expect(parseResult, isNotNull);
- expect(driver.knownFiles, contains(p));
- }
-
test_part_getErrors_afterLibrary() async {
var a = convertPath('/test/lib/a.dart');
var b = convertPath('/test/lib/b.dart');
@@ -3241,143 +2699,6 @@
}
}
- @deprecated
- test_part_getUnitElement_afterLibrary() async {
- var a = convertPath('/test/lib/a.dart');
- var b = convertPath('/test/lib/b.dart');
- var c = convertPath('/test/lib/c.dart');
- newFile(a, content: r'''
-library a;
-import 'b.dart';
-part 'c.dart';
-class A {}
-var c = new C();
-''');
- newFile(b, content: 'class B {}');
- newFile(c, content: r'''
-part of a;
-class C {}
-var a = new A();
-var b = new B();
-''');
-
- driver.addFile(a);
- driver.addFile(b);
- driver.addFile(c);
-
- // Process a.dart so that we know that it's a library for c.dart later.
- await driver.getResultValid(a);
-
- // c.dart is resolve in the context of a.dart, knows 'A' and 'B'.
- {
- UnitElementResult result = await driver.getUnitElement(c);
- var partUnit = result.element;
-
- assertType(partUnit.topLevelVariables[0].type, 'A');
- assertType(partUnit.topLevelVariables[1].type, 'B');
-
- var libraryUnit = partUnit.library.definingCompilationUnit;
- assertType(libraryUnit.topLevelVariables[0].type, 'C');
- }
- }
-
- @deprecated
- test_part_getUnitElement_beforeLibrary() async {
- var a = convertPath('/test/lib/a.dart');
- var b = convertPath('/test/lib/b.dart');
- var c = convertPath('/test/lib/c.dart');
- newFile(a, content: r'''
-library a;
-import 'b.dart';
-part 'c.dart';
-class A {}
-var c = new C();
-''');
- newFile(b, content: 'class B {}');
- newFile(c, content: r'''
-part of a;
-class C {}
-var a = new A();
-var b = new B();
-''');
-
- driver.addFile(a);
- driver.addFile(b);
- driver.addFile(c);
-
- // c.dart is resolve in the context of a.dart, knows 'A' and 'B'.
- {
- UnitElementResult result = await driver.getUnitElement(c);
- var partUnit = result.element;
-
- assertType(partUnit.topLevelVariables[0].type, 'A');
- assertType(partUnit.topLevelVariables[1].type, 'B');
-
- var libraryUnit = partUnit.library.definingCompilationUnit;
- assertType(libraryUnit.topLevelVariables[0].type, 'C');
- }
- }
-
- @deprecated
- test_part_getUnitElement_noLibrary() async {
- var c = convertPath('/test/lib/c.dart');
- newFile(c, content: r'''
-part of a;
-var a = new A();
-var b = new B();
-''');
-
- driver.addFile(c);
-
- // We don't know the library of c.dart, but we should get a result.
- // The types "A" and "B" are unresolved.
- {
- UnitElementResult result = await driver.getUnitElement(c);
- var partUnit = result.element;
-
- expect(partUnit.topLevelVariables[0].name, 'a');
- assertType(partUnit.topLevelVariables[0].type, 'dynamic');
-
- expect(partUnit.topLevelVariables[1].name, 'b');
- assertType(partUnit.topLevelVariables[1].type, 'dynamic');
- }
- }
-
- @deprecated
- test_part_getUnitElementSignature() async {
- var a = convertPath('/test/lib/a.dart');
- var b = convertPath('/test/lib/b.dart');
- var c = convertPath('/test/lib/c.dart');
- newFile(a, content: r'''
-library a;
-import 'b.dart';
-part 'c.dart';
-class A {}
-var c = new C();
-''');
- newFile(b, content: 'class B {}');
- newFile(c, content: r'''
-part of a;
-class C {}
-var a = new A();
-var b = new B();
-''');
-
- driver.addFile(a);
- driver.addFile(b);
- driver.addFile(c);
-
- // Compute the signature before analyzing the library.
- String signatureBefore = await driver.getUnitElementSignature(c);
-
- // Process a.dart so that we know that it's a library for c.dart later.
- await driver.getResultValid(a);
-
- // The before and after signatures must be the same.
- String signatureAfter = await driver.getUnitElementSignature(c);
- expect(signatureBefore, signatureAfter);
- }
-
test_part_results_afterLibrary() async {
var a = convertPath('/test/lib/a.dart');
var b = convertPath('/test/lib/b.dart');
diff --git a/pkg/analyzer/test/src/dart/analysis/session_test.dart b/pkg/analyzer/test/src/dart/analysis/session_test.dart
index b560691..1d2f2b0 100644
--- a/pkg/analyzer/test/src/dart/analysis/session_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/session_test.dart
@@ -10,7 +10,6 @@
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/src/dart/analysis/analysis_context_collection.dart';
import 'package:analyzer/src/dart/analysis/session.dart';
-import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/test_utilities/mock_sdk.dart';
import 'package:analyzer/src/test_utilities/resource_provider_mixin.dart';
import 'package:test/test.dart';
@@ -52,33 +51,6 @@
expect(result.uri.toString(), 'package:dart.my/a.dart');
}
- @deprecated
- void test_getErrors_notFileOfUri() async {
- var relPath = 'dart/my/lib/a.dart';
- newFile('$workspaceRootPath/bazel-bin/$relPath');
-
- var path = convertPath('$workspaceRootPath/$relPath');
- var session = contextFor(path).currentSession;
- var result = await session.getErrors(path);
- expect(result.state, ResultState.NOT_FILE_OF_URI);
- expect(() => result.errors, throwsStateError);
- }
-
- @deprecated
- void test_getErrors_valid() async {
- var file = newFile(
- '$workspaceRootPath/dart/my/lib/a.dart',
- content: 'var x = 0',
- );
-
- var session = contextFor(file.path).currentSession;
- var result = await session.getErrors(file.path);
- expect(result.state, ResultState.VALID);
- expect(result.path, file.path);
- expect(result.errors, hasLength(1));
- expect(result.uri.toString(), 'package:dart.my/a.dart');
- }
-
void test_getParsedLibrary2_notFileOfUri() async {
var relPath = 'dart/my/lib/a.dart';
newFile('$workspaceRootPath/bazel-bin/$relPath');
@@ -124,33 +96,6 @@
expect(result.uri.toString(), 'package:dart.my/a.dart');
}
- @deprecated
- void test_getResolvedUnit_notFileOfUri() async {
- var relPath = 'dart/my/lib/a.dart';
- newFile('$workspaceRootPath/bazel-bin/$relPath');
-
- var path = convertPath('$workspaceRootPath/$relPath');
- var session = contextFor(path).currentSession;
- var result = await session.getResolvedUnit(path);
- expect(result.state, ResultState.NOT_FILE_OF_URI);
- expect(() => result.errors, throwsStateError);
- }
-
- @deprecated
- void test_getResolvedUnit_valid() async {
- var file = newFile(
- '$workspaceRootPath/dart/my/lib/a.dart',
- content: 'class A {}',
- );
-
- var session = contextFor(file.path).currentSession;
- var result = await session.getResolvedUnit(file.path);
- expect(result.state, ResultState.VALID);
- expect(result.path, file.path);
- expect(result.errors, isEmpty);
- expect(result.uri.toString(), 'package:dart.my/a.dart');
- }
-
void test_getUnitElement2_invalidPath_notAbsolute() async {
var file = newFile(
'$workspaceRootPath/dart/my/lib/a.dart',
@@ -185,33 +130,6 @@
expect(result.element.classes, hasLength(1));
expect(result.uri.toString(), 'package:dart.my/a.dart');
}
-
- @deprecated
- void test_getUnitElement_notFileOfUri() async {
- var relPath = 'dart/my/lib/a.dart';
- newFile('$workspaceRootPath/bazel-bin/$relPath');
-
- var path = convertPath('$workspaceRootPath/$relPath');
- var session = contextFor(path).currentSession;
- var result = await session.getUnitElement(path);
- expect(result.state, ResultState.NOT_FILE_OF_URI);
- expect(() => result.element, throwsStateError);
- }
-
- @deprecated
- void test_getUnitElement_valid() async {
- var file = newFile(
- '$workspaceRootPath/dart/my/lib/a.dart',
- content: 'class A {}',
- );
-
- var session = contextFor(file.path).currentSession;
- var result = await session.getUnitElement(file.path);
- expect(result.state, ResultState.VALID);
- expect(result.path, file.path);
- expect(result.element.types, hasLength(1));
- expect(result.uri.toString(), 'package:dart.my/a.dart');
- }
}
@reflectiveTest
@@ -248,15 +166,6 @@
testPath = convertPath('/home/test/lib/test.dart');
}
- @deprecated
- test_getErrors() async {
- newFile(testPath, content: 'class C {');
- var errorsResult = await session.getErrors(testPath);
- expect(errorsResult.session, session);
- expect(errorsResult.path, testPath);
- expect(errorsResult.errors, isNotEmpty);
- }
-
test_getErrors2() async {
newFile(testPath, content: 'class C {');
var errorsResult = await session.getErrorsValid(testPath);
@@ -293,19 +202,6 @@
expect(file.isPart, isTrue);
}
- @deprecated
- test_getLibraryByUri() async {
- newFile(testPath, content: r'''
-class A {}
-class B {}
-''');
-
- var library = await session.getLibraryByUri('package:test/test.dart');
- expect(library.getType('A'), isNotNull);
- expect(library.getType('B'), isNotNull);
- expect(library.getType('C'), isNull);
- }
-
test_getLibraryByUri2() async {
newFile(testPath, content: r'''
class A {}
@@ -324,35 +220,6 @@
expect(result, isA<CannotResolveUriResult>());
}
- @deprecated
- test_getLibraryByUri_unresolvedUri() async {
- expect(() async {
- await session.getLibraryByUri('package:foo/foo.dart');
- }, throwsArgumentError);
- }
-
- @deprecated
- test_getParsedLibrary() async {
- newFile(testPath, content: r'''
-class A {}
-class B {}
-''');
-
- var parsedLibrary = session.getParsedLibrary(testPath);
- expect(parsedLibrary.session, session);
- expect(parsedLibrary.path, testPath);
- expect(parsedLibrary.uri, Uri.parse('package:test/test.dart'));
-
- expect(parsedLibrary.units, hasLength(1));
- {
- var parsedUnit = parsedLibrary.units![0];
- expect(parsedUnit.session, session);
- expect(parsedUnit.path, testPath);
- expect(parsedUnit.uri, Uri.parse('package:test/test.dart'));
- expect(parsedUnit.unit.declarations, hasLength(2));
- }
- }
-
test_getParsedLibrary2() async {
newFile(testPath, content: r'''
class A {}
@@ -461,21 +328,6 @@
expect(node.length, 10);
}
- @deprecated
- test_getParsedLibrary_getElementDeclaration_notThisLibrary() async {
- newFile(testPath, content: '');
-
- var resolvedUnit = await session.getResolvedUnit(testPath);
- var typeProvider = resolvedUnit.typeProvider;
- var intClass = typeProvider.intType.element;
-
- var parsedLibrary = session.getParsedLibrary(testPath);
-
- expect(() {
- parsedLibrary.getElementDeclaration(intClass);
- }, throwsArgumentError);
- }
-
test_getParsedLibrary_getElementDeclaration_notThisLibrary2() async {
newFile(testPath, content: '');
@@ -498,34 +350,8 @@
var parsedLibrary = session.getParsedLibraryValid(testPath);
- var unitResult = await session.getUnitElement2(testPath);
- var unitElement = (unitResult as UnitElementResult).element;
- var fooElement = unitElement.topLevelVariables[0];
- expect(fooElement.name, 'foo');
-
- // We can get the variable element declaration.
- var fooDeclaration = parsedLibrary.getElementDeclaration(fooElement)!;
- var fooNode = fooDeclaration.node as VariableDeclaration;
- expect(fooNode.name.name, 'foo');
- expect(fooNode.offset, 4);
- expect(fooNode.length, 7);
- expect(fooNode.name.staticElement, isNull);
-
- // Synthetic elements don't have nodes.
- expect(parsedLibrary.getElementDeclaration(fooElement.getter!), isNull);
- expect(parsedLibrary.getElementDeclaration(fooElement.setter!), isNull);
- }
-
- @deprecated
- test_getParsedLibrary_getElementDeclaration_synthetic_deprecated() async {
- newFile(testPath, content: r'''
-int foo = 0;
-''');
-
- var parsedLibrary = session.getParsedLibrary(testPath);
-
- var unitElement = (await session.getUnitElement(testPath)).element;
- var fooElement = unitElement.topLevelVariables[0];
+ var unitResult = await session.getUnitElementValid(testPath);
+ var fooElement = unitResult.element.topLevelVariables[0];
expect(fooElement.name, 'foo');
// We can get the variable element declaration.
@@ -565,90 +391,6 @@
);
}
- @deprecated
- test_getParsedLibrary_notLibrary() async {
- newFile(testPath, content: 'part of "a.dart";');
-
- expect(() {
- session.getParsedLibrary(testPath);
- }, throwsArgumentError);
- }
-
- @deprecated
- test_getParsedLibrary_parts() async {
- var a = convertPath('/home/test/lib/a.dart');
- var b = convertPath('/home/test/lib/b.dart');
- var c = convertPath('/home/test/lib/c.dart');
-
- var aContent = r'''
-part 'b.dart';
-part 'c.dart';
-
-class A {}
-''';
-
- var bContent = r'''
-part of 'a.dart';
-
-class B1 {}
-class B2 {}
-''';
-
- var cContent = r'''
-part of 'a.dart';
-
-class C1 {}
-class C2 {}
-class C3 {}
-''';
-
- newFile(a, content: aContent);
- newFile(b, content: bContent);
- newFile(c, content: cContent);
-
- var parsedLibrary = session.getParsedLibrary(a);
- expect(parsedLibrary.path, a);
- expect(parsedLibrary.uri, Uri.parse('package:test/a.dart'));
- expect(parsedLibrary.units, hasLength(3));
-
- {
- var aUnit = parsedLibrary.units![0];
- expect(aUnit.path, a);
- expect(aUnit.uri, Uri.parse('package:test/a.dart'));
- expect(aUnit.unit.declarations, hasLength(1));
- }
-
- {
- var bUnit = parsedLibrary.units![1];
- expect(bUnit.path, b);
- expect(bUnit.uri, Uri.parse('package:test/b.dart'));
- expect(bUnit.unit.declarations, hasLength(2));
- }
-
- {
- var cUnit = parsedLibrary.units![2];
- expect(cUnit.path, c);
- expect(cUnit.uri, Uri.parse('package:test/c.dart'));
- expect(cUnit.unit.declarations, hasLength(3));
- }
- }
-
- @deprecated
- test_getParsedLibraryByElement() async {
- newFile(testPath, content: '');
-
- var libraryResult = await session.getLibraryByUriValid(
- 'package:test/test.dart',
- );
- var element = libraryResult.element;
-
- var parsedLibrary = session.getParsedLibraryByElement(element);
- expect(parsedLibrary.session, session);
- expect(parsedLibrary.path, testPath);
- expect(parsedLibrary.uri, Uri.parse('package:test/test.dart'));
- expect(parsedLibrary.units, hasLength(1));
- }
-
test_getParsedLibraryByElement2() async {
newFile(testPath, content: '');
@@ -679,37 +421,6 @@
expect(result, isA<NotElementOfThisSessionResult>());
}
- @deprecated
- test_getParsedLibraryByElement_differentSession() async {
- newFile(testPath, content: '');
-
- var libraryResult = await session.getLibraryByUriValid(
- 'package:test/test.dart',
- );
- var element = libraryResult.element;
-
- var aaaSession =
- contextCollection.contextFor(aaaContextPath).currentSession;
-
- expect(() {
- aaaSession.getParsedLibraryByElement(element);
- }, throwsArgumentError);
- }
-
- @deprecated
- test_getParsedUnit() async {
- newFile(testPath, content: r'''
-class A {}
-class B {}
-''');
-
- var unitResult = session.getParsedUnit(testPath);
- expect(unitResult.session, session);
- expect(unitResult.path, testPath);
- expect(unitResult.uri, Uri.parse('package:test/test.dart'));
- expect(unitResult.unit.declarations, hasLength(2));
- }
-
test_getParsedUnit2() async {
newFile(testPath, content: r'''
class A {}
@@ -865,29 +576,6 @@
);
}
- @deprecated
- test_getResolvedLibrary_notLibrary() async {
- newFile(testPath, content: 'part of "a.dart";');
-
- expect(() async {
- await session.getResolvedLibrary(testPath);
- }, throwsArgumentError);
- }
-
- @deprecated
- test_getResolvedLibraryByElement() async {
- newFile(testPath, content: '');
-
- var element = await session.getLibraryByUri('package:test/test.dart');
-
- var resolvedLibrary = await session.getResolvedLibraryByElement(element);
- expect(resolvedLibrary.session, session);
- expect(resolvedLibrary.path, testPath);
- expect(resolvedLibrary.uri, Uri.parse('package:test/test.dart'));
- expect(resolvedLibrary.units, hasLength(1));
- expect(resolvedLibrary.units![0].unit!.declaredElement, isNotNull);
- }
-
test_getResolvedLibraryByElement2() async {
newFile(testPath, content: '');
@@ -919,36 +607,6 @@
expect(result, isA<NotElementOfThisSessionResult>());
}
- @deprecated
- test_getResolvedLibraryByElement_differentSession() async {
- newFile(testPath, content: '');
-
- var element = await session.getLibraryByUri('package:test/test.dart');
-
- var aaaSession =
- contextCollection.contextFor(aaaContextPath).currentSession;
-
- expect(() async {
- await aaaSession.getResolvedLibraryByElement(element);
- }, throwsArgumentError);
- }
-
- @deprecated
- test_getResolvedUnit() async {
- newFile(testPath, content: r'''
-class A {}
-class B {}
-''');
-
- var unitResult = await session.getResolvedUnit(testPath);
- expect(unitResult.session, session);
- expect(unitResult.path, testPath);
- expect(unitResult.uri, Uri.parse('package:test/test.dart'));
- expect(unitResult.unit!.declarations, hasLength(2));
- expect(unitResult.typeProvider, isNotNull);
- expect(unitResult.libraryElement, isNotNull);
- }
-
test_getResolvedUnit2() async {
newFile(testPath, content: r'''
class A {}
@@ -965,39 +623,6 @@
expect(unitResult.libraryElement, isNotNull);
}
- @deprecated
- test_getSourceKind() async {
- newFile(testPath, content: 'class C {}');
-
- var kind = await session.getSourceKind(testPath);
- expect(kind, SourceKind.LIBRARY);
- }
-
- @deprecated
- test_getSourceKind_part() async {
- newFile(testPath, content: 'part of "a.dart";');
-
- var kind = await session.getSourceKind(testPath);
- expect(kind, SourceKind.PART);
- }
-
- @deprecated
- test_getUnitElement() async {
- newFile(testPath, content: r'''
-class A {}
-class B {}
-''');
-
- var unitResult = await session.getUnitElement(testPath);
- expect(unitResult.session, session);
- expect(unitResult.path, testPath);
- expect(unitResult.uri, Uri.parse('package:test/test.dart'));
- expect(unitResult.element.types, hasLength(2));
-
- var signature = await session.getUnitElementSignature(testPath);
- expect(unitResult.signature, signature);
- }
-
test_getUnitElement2() async {
newFile(testPath, content: r'''
class A {}
diff --git a/pkg/analyzer/test/src/dart/resolution/resolution.dart b/pkg/analyzer/test/src/dart/resolution/resolution.dart
index 65d329f..2080ec9 100644
--- a/pkg/analyzer/test/src/dart/resolution/resolution.dart
+++ b/pkg/analyzer/test/src/dart/resolution/resolution.dart
@@ -756,17 +756,6 @@
}) {
assertElement2(type.aliasElement, declaration: element);
assertElementTypeStrings(type.aliasArguments, typeArguments);
-
- // TODO(scheglov) https://github.com/dart-lang/sdk/issues/44629
- if (type is FunctionType) {
- assertElement2(
- // ignore: deprecated_member_use_from_same_package
- type.element,
- declaration: element.aliasedElement as GenericFunctionTypeElement,
- );
- // ignore: deprecated_member_use_from_same_package
- assertElementTypeStrings(type.typeArguments, typeArguments);
- }
}
/// Assert that the given [identifier] is a reference to a type alias, in the
diff --git a/pkg/analyzer/test/src/diagnostics/annotation_on_pointer_field_test.dart b/pkg/analyzer/test/src/diagnostics/annotation_on_pointer_field_test.dart
index 979d17e..1572e37 100644
--- a/pkg/analyzer/test/src/diagnostics/annotation_on_pointer_field_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/annotation_on_pointer_field_test.dart
@@ -19,7 +19,8 @@
await assertErrorsInCode(r'''
import 'dart:ffi';
class C extends Struct {
- @Double() Pointer<Int8> x;
+ @Double()
+ external Pointer<Int8> x;
}
''', [
error(FfiCode.ANNOTATION_ON_POINTER_FIELD, 46, 9),
@@ -30,7 +31,8 @@
await assertErrorsInCode(r'''
import 'dart:ffi';
class C extends Struct {
- @Int32() Pointer<Float> x;
+ @Int32()
+ external Pointer<Float> x;
}
''', [
error(FfiCode.ANNOTATION_ON_POINTER_FIELD, 46, 8),
diff --git a/pkg/analyzer/test/src/diagnostics/extra_annotation_on_struct_field_test.dart b/pkg/analyzer/test/src/diagnostics/extra_annotation_on_struct_field_test.dart
index 11f9c6c..15f5566 100644
--- a/pkg/analyzer/test/src/diagnostics/extra_annotation_on_struct_field_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/extra_annotation_on_struct_field_test.dart
@@ -19,7 +19,8 @@
await assertNoErrorsInCode(r'''
import 'dart:ffi';
class C extends Struct {
- @Int32() int x;
+ @Int32()
+ external int x;
}
''');
}
@@ -28,10 +29,12 @@
await assertErrorsInCode(r'''
import 'dart:ffi';
class C extends Struct {
- @Int32() @Int16() int x;
+ @Int32()
+ @Int16()
+ external int x;
}
''', [
- error(FfiCode.EXTRA_ANNOTATION_ON_STRUCT_FIELD, 55, 8),
+ error(FfiCode.EXTRA_ANNOTATION_ON_STRUCT_FIELD, 57, 8),
]);
}
}
diff --git a/pkg/analyzer/test/src/diagnostics/extra_size_annotation_carray_test.dart b/pkg/analyzer/test/src/diagnostics/extra_size_annotation_carray_test.dart
index e0fd420..cbc9748 100644
--- a/pkg/analyzer/test/src/diagnostics/extra_size_annotation_carray_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/extra_size_annotation_carray_test.dart
@@ -23,7 +23,7 @@
class Struct8BytesInlineArrayInt extends Struct {
@Array(EIGHT)
- Array<Uint8> a0;
+ external Array<Uint8> a0;
}
''');
}
@@ -34,7 +34,7 @@
class C extends Struct {
@Array(8)
- Array<Uint8> a0;
+ external Array<Uint8> a0;
}
''');
}
@@ -46,7 +46,7 @@
class C extends Struct {
@Array(8)
@Array(8)
- Array<Uint8> a0;
+ external Array<Uint8> a0;
}
''', [
error(FfiCode.EXTRA_SIZE_ANNOTATION_CARRAY, 59, 9),
diff --git a/pkg/analyzer/test/src/diagnostics/field_in_struct_with_initializer_test.dart b/pkg/analyzer/test/src/diagnostics/field_in_struct_with_initializer_test.dart
index 426ff14..dc6b3de 100644
--- a/pkg/analyzer/test/src/diagnostics/field_in_struct_with_initializer_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/field_in_struct_with_initializer_test.dart
@@ -14,7 +14,8 @@
}
@reflectiveTest
-class FieldInStructWithInitializerTest extends PubPackageResolutionTest {
+class FieldInStructWithInitializerTest extends PubPackageResolutionTest
+ with WithoutNullSafetyMixin {
test_instance_withInitializer() async {
await assertErrorsInCode(r'''
import 'dart:ffi';
@@ -41,7 +42,7 @@
await assertNoErrorsInCode(r'''
import 'dart:ffi';
class C extends Struct {
- Pointer? p;
+ Pointer p;
}
''');
}
@@ -50,8 +51,8 @@
await assertNoErrorsInCode(r'''
import 'dart:ffi';
class C extends Struct {
- Pointer? p;
static String str = '';
+ Pointer p;
}
''');
}
diff --git a/pkg/analyzer/test/src/diagnostics/field_initializer_in_struct_test.dart b/pkg/analyzer/test/src/diagnostics/field_initializer_in_struct_test.dart
index dd2978f..b0027ed 100644
--- a/pkg/analyzer/test/src/diagnostics/field_initializer_in_struct_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/field_initializer_in_struct_test.dart
@@ -14,7 +14,8 @@
}
@reflectiveTest
-class FieldInitializerInStructTest extends PubPackageResolutionTest {
+class FieldInitializerInStructTest extends PubPackageResolutionTest
+ with WithoutNullSafetyMixin {
test_fieldInitializer() async {
await assertErrorsInCode('''
import 'dart:ffi';
@@ -43,7 +44,7 @@
await assertNoErrorsInCode('''
import 'dart:ffi';
class C extends Struct {
- @Int32() int? f;
+ @Int32() int f;
C() : super();
}
''');
diff --git a/pkg/analyzer/test/src/diagnostics/field_must_be_external_in_struct_test.dart b/pkg/analyzer/test/src/diagnostics/field_must_be_external_in_struct_test.dart
new file mode 100644
index 0000000..d03d1b9
--- /dev/null
+++ b/pkg/analyzer/test/src/diagnostics/field_must_be_external_in_struct_test.dart
@@ -0,0 +1,54 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analyzer/src/dart/error/ffi_code.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import '../dart/resolution/context_collection_resolution.dart';
+
+main() {
+ defineReflectiveSuite(() {
+ defineReflectiveTests(FieldMustBeExternalInStructTest);
+ defineReflectiveTests(FieldMustBeExternalInStructWithoutNullSafetyTest);
+ });
+}
+
+@reflectiveTest
+class FieldMustBeExternalInStructTest extends PubPackageResolutionTest
+ with FieldMustBeExternalInStructTestCases {}
+
+mixin FieldMustBeExternalInStructTestCases on PubPackageResolutionTest {
+ test_struct() async {
+ var expectedErrors = expectedErrorsByNullability(nullable: [
+ error(FfiCode.FIELD_MUST_BE_EXTERNAL_IN_STRUCT, 62, 1),
+ ], legacy: []);
+ await assertErrorsInCode(r'''
+import 'dart:ffi';
+
+class A extends Struct {
+ @Int16()
+ int a;
+}
+''', expectedErrors);
+ }
+
+ test_union() async {
+ var expectedErrors = expectedErrorsByNullability(nullable: [
+ error(FfiCode.FIELD_MUST_BE_EXTERNAL_IN_STRUCT, 61, 1),
+ ], legacy: []);
+ await assertErrorsInCode(r'''
+import 'dart:ffi';
+
+class A extends Union {
+ @Int16()
+ int a;
+}
+''', expectedErrors);
+ }
+}
+
+@reflectiveTest
+class FieldMustBeExternalInStructWithoutNullSafetyTest
+ extends PubPackageResolutionTest
+ with WithoutNullSafetyMixin, FieldMustBeExternalInStructTestCases {}
diff --git a/pkg/analyzer/test/src/diagnostics/mismatched_annotation_on_struct_field_test.dart b/pkg/analyzer/test/src/diagnostics/mismatched_annotation_on_struct_field_test.dart
index b404bde..bca3f8d 100644
--- a/pkg/analyzer/test/src/diagnostics/mismatched_annotation_on_struct_field_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/mismatched_annotation_on_struct_field_test.dart
@@ -19,7 +19,8 @@
await assertErrorsInCode(r'''
import 'dart:ffi';
class C extends Struct {
- @Double() int x;
+ @Double()
+ external int x;
}
''', [
error(FfiCode.MISMATCHED_ANNOTATION_ON_STRUCT_FIELD, 46, 9),
@@ -30,7 +31,8 @@
await assertErrorsInCode(r'''
import 'dart:ffi';
class C extends Struct {
- @Int32() double x;
+ @Int32()
+ external double x;
}
''', [
error(FfiCode.MISMATCHED_ANNOTATION_ON_STRUCT_FIELD, 46, 8),
diff --git a/pkg/analyzer/test/src/diagnostics/missing_annotation_on_struct_field_test.dart b/pkg/analyzer/test/src/diagnostics/missing_annotation_on_struct_field_test.dart
index 1a5a83c..3fe5eba 100644
--- a/pkg/analyzer/test/src/diagnostics/missing_annotation_on_struct_field_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/missing_annotation_on_struct_field_test.dart
@@ -19,10 +19,10 @@
await assertErrorsInCode(r'''
import 'dart:ffi';
class C extends Struct {
- int x;
+ external int x;
}
''', [
- error(FfiCode.MISSING_ANNOTATION_ON_STRUCT_FIELD, 46, 3),
+ error(FfiCode.MISSING_ANNOTATION_ON_STRUCT_FIELD, 55, 3),
]);
}
@@ -30,7 +30,8 @@
await assertNoErrorsInCode(r'''
import 'dart:ffi';
class C extends Struct {
- @Int32() int x;
+ @Int32()
+ external int x;
}
''');
}
diff --git a/pkg/analyzer/test/src/diagnostics/missing_field_type_in_struct_test.dart b/pkg/analyzer/test/src/diagnostics/missing_field_type_in_struct_test.dart
index c5ae82c..08937af 100644
--- a/pkg/analyzer/test/src/diagnostics/missing_field_type_in_struct_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/missing_field_type_in_struct_test.dart
@@ -19,12 +19,12 @@
await assertErrorsInCode(r'''
import 'dart:ffi';
class C extends Struct {
- var str;
+ external var str;
- Pointer notEmpty;
+ external Pointer notEmpty;
}
''', [
- error(FfiCode.MISSING_FIELD_TYPE_IN_STRUCT, 50, 3),
+ error(FfiCode.MISSING_FIELD_TYPE_IN_STRUCT, 59, 3),
]);
}
@@ -32,7 +32,7 @@
await assertNoErrorsInCode(r'''
import 'dart:ffi';
class C extends Struct {
- Pointer p;
+ external Pointer p;
}
''');
}
diff --git a/pkg/analyzer/test/src/diagnostics/missing_size_annotation_carray_test.dart b/pkg/analyzer/test/src/diagnostics/missing_size_annotation_carray_test.dart
index 3ff4c3d..e424fc8 100644
--- a/pkg/analyzer/test/src/diagnostics/missing_size_annotation_carray_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/missing_size_annotation_carray_test.dart
@@ -21,7 +21,7 @@
class C extends Struct {
@Array(8)
- Array<Uint8> a0;
+ external Array<Uint8> a0;
}
''');
}
@@ -31,10 +31,10 @@
import 'dart:ffi';
class C extends Struct {
- Array<Uint8> a0;
+ external Array<Uint8> a0;
}
''', [
- error(FfiCode.MISSING_SIZE_ANNOTATION_CARRAY, 47, 12),
+ error(FfiCode.MISSING_SIZE_ANNOTATION_CARRAY, 56, 12),
]);
}
}
diff --git a/pkg/analyzer/test/src/diagnostics/non_constant_type_argument_test.dart b/pkg/analyzer/test/src/diagnostics/non_constant_type_argument_test.dart
index 9df668f..b51176c 100644
--- a/pkg/analyzer/test/src/diagnostics/non_constant_type_argument_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/non_constant_type_argument_test.dart
@@ -39,7 +39,7 @@
class MyStruct extends Struct {
@Uint8()
- int myField;
+ external int myField;
}
void main() {
@@ -55,7 +55,7 @@
class MyStruct extends Struct {
@Uint8()
- int myField;
+ external int myField;
}
void main() {
diff --git a/pkg/analyzer/test/src/diagnostics/not_initialized_non_nullable_instance_field_test.dart b/pkg/analyzer/test/src/diagnostics/not_initialized_non_nullable_instance_field_test.dart
index 3f4f184..df90e0a 100644
--- a/pkg/analyzer/test/src/diagnostics/not_initialized_non_nullable_instance_field_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/not_initialized_non_nullable_instance_field_test.dart
@@ -51,7 +51,7 @@
class A extends Struct {
@Double()
- double foo;
+ external double foo;
}
''');
}
diff --git a/pkg/analyzer/test/src/diagnostics/size_annotation_dimensions_test.dart b/pkg/analyzer/test/src/diagnostics/size_annotation_dimensions_test.dart
index 8a53708..7bc6949 100644
--- a/pkg/analyzer/test/src/diagnostics/size_annotation_dimensions_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/size_annotation_dimensions_test.dart
@@ -21,7 +21,7 @@
class C extends Struct {
@Array(8, 8)
- Array<Array<Array<Uint8>>> a0;
+ external Array<Array<Array<Uint8>>> a0;
}
''', [
error(FfiCode.SIZE_ANNOTATION_DIMENSIONS, 47, 12),
@@ -34,7 +34,7 @@
class C extends Struct {
@Array(8, 8, 8)
- Array<Array<Uint8>> a0;
+ external Array<Array<Uint8>> a0;
}
''', [
error(FfiCode.SIZE_ANNOTATION_DIMENSIONS, 47, 15),
@@ -47,7 +47,7 @@
class C extends Struct {
@Array.multi([8, 8])
- Array<Array<Array<Uint8>>> a0;
+ external Array<Array<Array<Uint8>>> a0;
}
''', [
error(FfiCode.SIZE_ANNOTATION_DIMENSIONS, 47, 20),
@@ -60,7 +60,7 @@
class C extends Struct {
@Array(8, 8)
- Array<Array<Uint8>> a0;
+ external Array<Array<Uint8>> a0;
}
''');
}
diff --git a/pkg/analyzer/test/src/diagnostics/test_all.dart b/pkg/analyzer/test/src/diagnostics/test_all.dart
index 7ec87d4..fd81c75 100644
--- a/pkg/analyzer/test/src/diagnostics/test_all.dart
+++ b/pkg/analyzer/test/src/diagnostics/test_all.dart
@@ -212,6 +212,8 @@
as field_initializer_redirecting_constructor;
import 'field_initializing_formal_not_assignable_test.dart'
as field_initializing_formal_not_assignable;
+import 'field_must_be_external_in_struct_test.dart'
+ as field_must_be_external_in_struct;
import 'final_initialized_in_delcaration_and_constructor_test.dart'
as final_initialized_in_declaration_and_constructor;
import 'final_not_initialized_constructor_test.dart'
@@ -853,6 +855,7 @@
field_initializer_outside_constructor.main();
field_initializer_redirecting_constructor.main();
field_initializing_formal_not_assignable.main();
+ field_must_be_external_in_struct.main();
final_not_initialized_constructor.main();
final_not_initialized.main();
for_in_of_invalid_element_type.main();
diff --git a/pkg/compiler/lib/src/commandline_options.dart b/pkg/compiler/lib/src/commandline_options.dart
index 7ff044b..771756b 100644
--- a/pkg/compiler/lib/src/commandline_options.dart
+++ b/pkg/compiler/lib/src/commandline_options.dart
@@ -52,6 +52,11 @@
static const String experimentNewRti = '--experiment-new-rti';
+ /// Use the dart2js lowering of late instance variables rather than the CFE
+ /// lowering.
+ static const String experimentLateInstanceVariables =
+ '--experiment-late-instance-variables';
+
static const String enableLanguageExperiments = '--enable-experiment';
static const String fastStartup = '--fast-startup';
diff --git a/pkg/compiler/lib/src/dart2js.dart b/pkg/compiler/lib/src/dart2js.dart
index 8907305..f506091 100644
--- a/pkg/compiler/lib/src/dart2js.dart
+++ b/pkg/compiler/lib/src/dart2js.dart
@@ -602,6 +602,7 @@
new OptionHandler(Flags.experimentUnreachableMethodsThrow, passThrough),
new OptionHandler(Flags.experimentCallInstrumentation, passThrough),
new OptionHandler(Flags.experimentNewRti, ignoreOption),
+ new OptionHandler(Flags.experimentLateInstanceVariables, passThrough),
new OptionHandler('${Flags.mergeFragmentsThreshold}=.+', passThrough),
// Wire up feature flags.
diff --git a/pkg/compiler/lib/src/kernel/dart2js_target.dart b/pkg/compiler/lib/src/kernel/dart2js_target.dart
index a1b5307..f939fe1 100644
--- a/pkg/compiler/lib/src/kernel/dart2js_target.dart
+++ b/pkg/compiler/lib/src/kernel/dart2js_target.dart
@@ -58,6 +58,19 @@
return allowedNativeTest(uri) || allowedDartLibrary();
}
+int _foldLateLowerings(List<int> lowerings) =>
+ lowerings.fold(LateLowering.none, (a, b) => a | b);
+
+/// Late lowerings which the frontend performs for dart2js.
+const List<int> _allEnabledLateLowerings = [
+ LateLowering.uninitializedNonFinalInstanceField,
+ LateLowering.uninitializedFinalInstanceField,
+ LateLowering.initializedNonFinalInstanceField,
+ LateLowering.initializedFinalInstanceField,
+];
+
+final int _enabledLateLowerings = _foldLateLowerings(_allEnabledLateLowerings);
+
/// A kernel [Target] to configure the Dart Front End for dart2js.
class Dart2jsTarget extends Target {
@override
@@ -75,7 +88,10 @@
bool get enableNoSuchMethodForwarders => true;
@override
- int get enabledLateLowerings => LateLowering.none;
+ int get enabledLateLowerings =>
+ (options != null && options.experimentLateInstanceVariables)
+ ? LateLowering.none
+ : _enabledLateLowerings;
@override
bool get supportsLateLoweringSentinel => true;
diff --git a/pkg/compiler/lib/src/kernel/transformations/late_lowering.dart b/pkg/compiler/lib/src/kernel/transformations/late_lowering.dart
index faab75d..210bbcb 100644
--- a/pkg/compiler/lib/src/kernel/transformations/late_lowering.dart
+++ b/pkg/compiler/lib/src/kernel/transformations/late_lowering.dart
@@ -22,6 +22,7 @@
final CoreTypes _coreTypes;
final bool _omitLateNames;
+ final bool _lowerInstanceVariables;
final _Reader _readLocal;
final _Reader _readField;
@@ -47,6 +48,8 @@
LateLowering(this._coreTypes, CompilerOptions _options)
: _omitLateNames = _options?.omitLateNames ?? false,
+ _lowerInstanceVariables =
+ _options?.experimentLateInstanceVariables ?? false,
_readLocal = _Reader(_coreTypes.cellReadLocal),
_readField = _Reader(_coreTypes.cellReadField),
_readInitialized = _Reader(_coreTypes.initializedCellRead),
@@ -66,7 +69,7 @@
field.isLate && field.isStatic && field.initializer == null;
bool _shouldLowerInstanceField(Field field) =>
- field.isLate && !field.isStatic;
+ field.isLate && !field.isStatic && _lowerInstanceVariables;
String _mangleFieldName(Field field) {
assert(_shouldLowerInstanceField(field));
diff --git a/pkg/compiler/lib/src/options.dart b/pkg/compiler/lib/src/options.dart
index 4a8640f..5c89ed6 100644
--- a/pkg/compiler/lib/src/options.dart
+++ b/pkg/compiler/lib/src/options.dart
@@ -471,6 +471,10 @@
/// called.
bool experimentCallInstrumentation = false;
+ /// Use the dart2js lowering of late instance variables rather than the CFE
+ /// lowering.
+ bool experimentLateInstanceVariables = false;
+
/// When null-safety is enabled, whether the compiler should emit code with
/// unsound or sound semantics.
///
@@ -595,6 +599,8 @@
_hasOption(options, Flags.experimentUnreachableMethodsThrow)
..experimentCallInstrumentation =
_hasOption(options, Flags.experimentCallInstrumentation)
+ ..experimentLateInstanceVariables =
+ _hasOption(options, Flags.experimentLateInstanceVariables)
..generateSourceMap = !_hasOption(options, Flags.noSourceMaps)
..outputUri = _extractUriOption(options, '--out=')
..platformBinaries = platformBinaries
diff --git a/pkg/front_end/testcases/dart2js/late_fields.dart.strong.expect b/pkg/front_end/testcases/dart2js/late_fields.dart.strong.expect
index ee029897..0c0fa5a 100644
--- a/pkg/front_end/testcases/dart2js/late_fields.dart.strong.expect
+++ b/pkg/front_end/testcases/dart2js/late_fields.dart.strong.expect
@@ -1,15 +1,33 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
+import "dart:_internal" as _in;
class C extends core::Object {
- late field core::int a;
- late final [setter] field core::int b;
- late field core::int c = 1.{core::int::unary-}(){() → core::int};
- late final field core::int d = 1.{core::int::unary-}(){() → core::int};
+ field core::int? _#C#a = null;
+ field core::int? _#C#b = null;
+ field core::int? _#C#c = null;
+ field core::int? _#C#d = null;
synthetic constructor •() → self::C
: super core::Object::•()
;
+ get a() → core::int
+ return let final core::int? #t1 = this.{self::C::_#C#a}{core::int?} in #t1 == null ?{core::int} throw new _in::LateError::fieldNI("a") : #t1{core::int};
+ set a(core::int #t2) → void
+ this.{self::C::_#C#a} = #t2;
+ get b() → core::int
+ return let final core::int? #t3 = this.{self::C::_#C#b}{core::int?} in #t3 == null ?{core::int} throw new _in::LateError::fieldNI("b") : #t3{core::int};
+ set b(core::int #t4) → void
+ if(this.{self::C::_#C#b}{core::int?} == null)
+ this.{self::C::_#C#b} = #t4;
+ else
+ throw new _in::LateError::fieldAI("b");
+ get c() → core::int
+ return let final core::int? #t5 = this.{self::C::_#C#c}{core::int?} in #t5 == null ?{core::int} this.{self::C::_#C#c} = 1.{core::int::unary-}(){() → core::int} : #t5{core::int};
+ set c(core::int #t6) → void
+ this.{self::C::_#C#c} = #t6;
+ get d() → core::int
+ return let final core::int? #t7 = this.{self::C::_#C#d}{core::int?} in #t7 == null ?{core::int} let final core::int #t8 = 1.{core::int::unary-}(){() → core::int} in this.{self::C::_#C#d}{core::int?} == null ?{core::int} this.{self::C::_#C#d} = #t8 : throw new _in::LateError::fieldADI("d") : #t7{core::int};
}
static field self::C c = new self::C::•();
static method main() → void {
diff --git a/pkg/front_end/testcases/dart2js/late_fields.dart.strong.transformed.expect b/pkg/front_end/testcases/dart2js/late_fields.dart.strong.transformed.expect
index 25ca1b2..e162d20 100644
--- a/pkg/front_end/testcases/dart2js/late_fields.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/dart2js/late_fields.dart.strong.transformed.expect
@@ -1,44 +1,33 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
-import "dart:_late_helper" as _la;
import "dart:_internal" as _in;
class C extends core::Object {
- field core::int _#C#a = _in::createSentinel<core::int>();
- field core::int _#C#b = _in::createSentinel<core::int>();
- field core::int _#C#c = _in::createSentinel<core::int>();
- field core::int _#C#d = _in::createSentinel<core::int>();
+ field core::int? _#C#a = null;
+ field core::int? _#C#b = null;
+ field core::int? _#C#c = null;
+ field core::int? _#C#d = null;
synthetic constructor •() → self::C
: super core::Object::•()
;
get a() → core::int
- return _la::_lateReadCheck<core::int>(this.{self::C::_#C#a}{core::int}, "a");
- set a(core::int value) → void
- this.{self::C::_#C#a} = value;
+ return let final core::int? #t1 = this.{self::C::_#C#a}{core::int?} in #t1 == null ?{core::int} throw new _in::LateError::fieldNI("a") : #t1{core::int};
+ set a(core::int #t2) → void
+ this.{self::C::_#C#a} = #t2;
get b() → core::int
- return _la::_lateReadCheck<core::int>(this.{self::C::_#C#b}{core::int}, "b");
- set b(core::int value) → void {
- _la::_lateWriteOnceCheck(this.{self::C::_#C#b}{core::int}, "b");
- this.{self::C::_#C#b} = value;
- }
- get c() → core::int {
- core::int value = this.{self::C::_#C#c}{core::int};
- if(_in::isSentinel(value))
- value = this.{self::C::_#C#c} = 1.{core::int::unary-}(){() → core::int};
- return value;
- }
- set c(core::int value) → void
- this.{self::C::_#C#c} = value;
- get d() → core::int {
- core::int value = this.{self::C::_#C#d}{core::int};
- if(_in::isSentinel(value)) {
- final core::int result = 1.{core::int::unary-}(){() → core::int};
- _la::_lateInitializeOnceCheck(this.{self::C::_#C#d}{core::int}, "d");
- value = this.{self::C::_#C#d} = result;
- }
- return value;
- }
+ return let final core::int? #t3 = this.{self::C::_#C#b}{core::int?} in #t3 == null ?{core::int} throw new _in::LateError::fieldNI("b") : #t3{core::int};
+ set b(core::int #t4) → void
+ if(this.{self::C::_#C#b}{core::int?} == null)
+ this.{self::C::_#C#b} = #t4;
+ else
+ throw new _in::LateError::fieldAI("b");
+ get c() → core::int
+ return let final core::int? #t5 = this.{self::C::_#C#c}{core::int?} in #t5 == null ?{core::int} this.{self::C::_#C#c} = 1.{core::int::unary-}(){() → core::int} : #t5{core::int};
+ set c(core::int #t6) → void
+ this.{self::C::_#C#c} = #t6;
+ get d() → core::int
+ return let final core::int? #t7 = this.{self::C::_#C#d}{core::int?} in #t7 == null ?{core::int} let final core::int #t8 = 1.{core::int::unary-}(){() → core::int} in this.{self::C::_#C#d}{core::int?} == null ?{core::int} this.{self::C::_#C#d} = #t8 : throw new _in::LateError::fieldADI("d") : #t7{core::int};
}
static field self::C c = new self::C::•();
static method main() → void {
@@ -70,4 +59,5 @@
Extra constant evaluation status:
Evaluated: InstanceInvocation @ org-dartlang-testcase:///late_fields.dart:15:16 -> DoubleConstant(-1.0)
Evaluated: InstanceInvocation @ org-dartlang-testcase:///late_fields.dart:16:22 -> DoubleConstant(-1.0)
-Extra constant evaluation: evaluated: 76, effectively constant: 2
+Evaluated: VariableGet @ org-dartlang-testcase:///late_fields.dart:16:18 -> DoubleConstant(-1.0)
+Extra constant evaluation: evaluated: 92, effectively constant: 3
diff --git a/pkg/front_end/testcases/dart2js/late_fields.dart.weak.expect b/pkg/front_end/testcases/dart2js/late_fields.dart.weak.expect
index ee029897..ca585bf 100644
--- a/pkg/front_end/testcases/dart2js/late_fields.dart.weak.expect
+++ b/pkg/front_end/testcases/dart2js/late_fields.dart.weak.expect
@@ -1,15 +1,33 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
+import "dart:_internal" as _in;
class C extends core::Object {
- late field core::int a;
- late final [setter] field core::int b;
- late field core::int c = 1.{core::int::unary-}(){() → core::int};
- late final field core::int d = 1.{core::int::unary-}(){() → core::int};
+ field core::int? _#C#a = _in::createSentinel<core::int>();
+ field core::int? _#C#b = _in::createSentinel<core::int>();
+ field core::int? _#C#c = _in::createSentinel<core::int>();
+ field core::int? _#C#d = _in::createSentinel<core::int>();
synthetic constructor •() → self::C
: super core::Object::•()
;
+ get a() → core::int
+ return let final core::int? #t1 = this.{self::C::_#C#a}{core::int?} in _in::isSentinel(#t1) ?{core::int} throw new _in::LateError::fieldNI("a") : #t1{core::int};
+ set a(core::int #t2) → void
+ this.{self::C::_#C#a} = #t2;
+ get b() → core::int
+ return let final core::int? #t3 = this.{self::C::_#C#b}{core::int?} in _in::isSentinel(#t3) ?{core::int} throw new _in::LateError::fieldNI("b") : #t3{core::int};
+ set b(core::int #t4) → void
+ if(_in::isSentinel(this.{self::C::_#C#b}{core::int?}))
+ this.{self::C::_#C#b} = #t4;
+ else
+ throw new _in::LateError::fieldAI("b");
+ get c() → core::int
+ return let final core::int? #t5 = this.{self::C::_#C#c}{core::int?} in _in::isSentinel(#t5) ?{core::int} this.{self::C::_#C#c} = 1.{core::int::unary-}(){() → core::int} : #t5{core::int};
+ set c(core::int #t6) → void
+ this.{self::C::_#C#c} = #t6;
+ get d() → core::int
+ return let final core::int #t7 = this.{self::C::_#C#d}{core::int?} in _in::isSentinel(#t7) ?{core::int} let final core::int #t8 = 1.{core::int::unary-}(){() → core::int} in _in::isSentinel(this.{self::C::_#C#d}{core::int?}) ?{core::int} this.{self::C::_#C#d} = #t8 : throw new _in::LateError::fieldADI("d") : #t7;
}
static field self::C c = new self::C::•();
static method main() → void {
diff --git a/pkg/front_end/testcases/dart2js/late_fields.dart.weak.outline.expect b/pkg/front_end/testcases/dart2js/late_fields.dart.weak.outline.expect
index 4f8c98b..09228574 100644
--- a/pkg/front_end/testcases/dart2js/late_fields.dart.weak.outline.expect
+++ b/pkg/front_end/testcases/dart2js/late_fields.dart.weak.outline.expect
@@ -3,12 +3,19 @@
import "dart:core" as core;
class C extends core::Object {
- late field core::int a;
- late final [setter] field core::int b;
- late field core::int c;
- late final field core::int d;
+ field core::int? _#C#a;
+ field core::int? _#C#b;
+ field core::int? _#C#c;
+ field core::int? _#C#d;
synthetic constructor •() → self::C
;
+ get a() → core::int;
+ set a(core::int #t1) → void;
+ get b() → core::int;
+ set b(core::int #t2) → void;
+ get c() → core::int;
+ set c(core::int #t3) → void;
+ get d() → core::int;
}
static field self::C c;
static method main() → void
diff --git a/pkg/front_end/testcases/dart2js/late_fields.dart.weak.transformed.expect b/pkg/front_end/testcases/dart2js/late_fields.dart.weak.transformed.expect
index 25ca1b2..06e4c45 100644
--- a/pkg/front_end/testcases/dart2js/late_fields.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/dart2js/late_fields.dart.weak.transformed.expect
@@ -1,44 +1,33 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
-import "dart:_late_helper" as _la;
import "dart:_internal" as _in;
class C extends core::Object {
- field core::int _#C#a = _in::createSentinel<core::int>();
- field core::int _#C#b = _in::createSentinel<core::int>();
- field core::int _#C#c = _in::createSentinel<core::int>();
- field core::int _#C#d = _in::createSentinel<core::int>();
+ field core::int? _#C#a = _in::createSentinel<core::int>();
+ field core::int? _#C#b = _in::createSentinel<core::int>();
+ field core::int? _#C#c = _in::createSentinel<core::int>();
+ field core::int? _#C#d = _in::createSentinel<core::int>();
synthetic constructor •() → self::C
: super core::Object::•()
;
get a() → core::int
- return _la::_lateReadCheck<core::int>(this.{self::C::_#C#a}{core::int}, "a");
- set a(core::int value) → void
- this.{self::C::_#C#a} = value;
+ return let final core::int? #t1 = this.{self::C::_#C#a}{core::int?} in _in::isSentinel(#t1) ?{core::int} throw new _in::LateError::fieldNI("a") : #t1{core::int};
+ set a(core::int #t2) → void
+ this.{self::C::_#C#a} = #t2;
get b() → core::int
- return _la::_lateReadCheck<core::int>(this.{self::C::_#C#b}{core::int}, "b");
- set b(core::int value) → void {
- _la::_lateWriteOnceCheck(this.{self::C::_#C#b}{core::int}, "b");
- this.{self::C::_#C#b} = value;
- }
- get c() → core::int {
- core::int value = this.{self::C::_#C#c}{core::int};
- if(_in::isSentinel(value))
- value = this.{self::C::_#C#c} = 1.{core::int::unary-}(){() → core::int};
- return value;
- }
- set c(core::int value) → void
- this.{self::C::_#C#c} = value;
- get d() → core::int {
- core::int value = this.{self::C::_#C#d}{core::int};
- if(_in::isSentinel(value)) {
- final core::int result = 1.{core::int::unary-}(){() → core::int};
- _la::_lateInitializeOnceCheck(this.{self::C::_#C#d}{core::int}, "d");
- value = this.{self::C::_#C#d} = result;
- }
- return value;
- }
+ return let final core::int? #t3 = this.{self::C::_#C#b}{core::int?} in _in::isSentinel(#t3) ?{core::int} throw new _in::LateError::fieldNI("b") : #t3{core::int};
+ set b(core::int #t4) → void
+ if(_in::isSentinel(this.{self::C::_#C#b}{core::int?}))
+ this.{self::C::_#C#b} = #t4;
+ else
+ throw new _in::LateError::fieldAI("b");
+ get c() → core::int
+ return let final core::int? #t5 = this.{self::C::_#C#c}{core::int?} in _in::isSentinel(#t5) ?{core::int} this.{self::C::_#C#c} = 1.{core::int::unary-}(){() → core::int} : #t5{core::int};
+ set c(core::int #t6) → void
+ this.{self::C::_#C#c} = #t6;
+ get d() → core::int
+ return let final core::int #t7 = this.{self::C::_#C#d}{core::int?} in _in::isSentinel(#t7) ?{core::int} let final core::int #t8 = 1.{core::int::unary-}(){() → core::int} in _in::isSentinel(this.{self::C::_#C#d}{core::int?}) ?{core::int} this.{self::C::_#C#d} = #t8 : throw new _in::LateError::fieldADI("d") : #t7;
}
static field self::C c = new self::C::•();
static method main() → void {
@@ -70,4 +59,5 @@
Extra constant evaluation status:
Evaluated: InstanceInvocation @ org-dartlang-testcase:///late_fields.dart:15:16 -> DoubleConstant(-1.0)
Evaluated: InstanceInvocation @ org-dartlang-testcase:///late_fields.dart:16:22 -> DoubleConstant(-1.0)
-Extra constant evaluation: evaluated: 76, effectively constant: 2
+Evaluated: VariableGet @ org-dartlang-testcase:///late_fields.dart:16:18 -> DoubleConstant(-1.0)
+Extra constant evaluation: evaluated: 96, effectively constant: 3
diff --git a/pkg/meta/CHANGELOG.md b/pkg/meta/CHANGELOG.md
index 9a608f0..f038761 100644
--- a/pkg/meta/CHANGELOG.md
+++ b/pkg/meta/CHANGELOG.md
@@ -1,3 +1,17 @@
+## 2.0.0
+
+* Restore `TargetKindExtension` and `get displayString`.
+
+## 1.6.0
+
+* Remove `TargetKindExtension`. Adding it was a breaking change, because there
+ are clients, e.g. `analyze 1.7.0`, that also declare an extension on
+ `TargetKind`, and also declare `get displayString`. This causes a conflict.
+
+## 1.5.0
+
+* Add `TargetKindExtension.displayString`.
+
## 1.4.0
* Introduce `TargetKind.topLevelVariable` that indicates that an annotation
diff --git a/pkg/meta/README.md b/pkg/meta/README.md
index c6c710d..9df903f 100644
--- a/pkg/meta/README.md
+++ b/pkg/meta/README.md
@@ -9,7 +9,7 @@
The library in `meta.dart` defines annotations that can be used by static
analysis tools to provide a more complete analysis of the code that uses them.
-Within the SDK, these tools include the command-line analyzer (`dartanalyzer`)
+Within the SDK, these tools include the command-line analyzer (`dart analyze`)
and the analysis server that is used to power many of the Dart-enabled
development tools.
diff --git a/pkg/meta/pubspec.yaml b/pkg/meta/pubspec.yaml
index acf4559..b407064 100644
--- a/pkg/meta/pubspec.yaml
+++ b/pkg/meta/pubspec.yaml
@@ -1,10 +1,9 @@
name: meta
-version: 1.4.0
+version: 2.0.0
homepage: https://github.com/dart-lang/sdk/tree/master/pkg/meta
-description: >
- This library contains the declarations of annotations that developers can use
- to express the intentions that otherwise can't be deduced by statically
- analyzing the source code. These annotations are intended to be used by tools
- to provide a better user experience.
+description: >-
+ Annotations that developers can use to express the intentions that otherwise
+ can't be deduced by statically analyzing the source code. These annotations
+ are intended to be used by tools to provide a better user experience.
environment:
- sdk: ">=2.12.0-0 <3.0.0"
+ sdk: ">=2.12.0 <3.0.0"
diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn
index bc87833..3016678 100644
--- a/runtime/BUILD.gn
+++ b/runtime/BUILD.gn
@@ -71,22 +71,22 @@
defines = []
if (target_os == "android") {
- defines += [ "TARGET_OS_ANDROID" ]
+ defines += [ "DART_TARGET_OS_ANDROID" ]
} else if (target_os == "fuchsia") {
- defines += [ "TARGET_OS_FUCHSIA" ]
+ defines += [ "DART_TARGET_OS_FUCHSIA" ]
} else if (target_os == "ios") {
- defines += [ "TARGET_OS_MACOS" ]
- defines += [ "TARGET_OS_MACOS_IOS" ]
+ defines += [ "DART_TARGET_OS_MACOS" ]
+ defines += [ "DART_TARGET_OS_MACOS_IOS" ]
} else if (target_os == "linux") {
- defines += [ "TARGET_OS_LINUX" ]
+ defines += [ "DART_TARGET_OS_LINUX" ]
} else if (target_os == "mac") {
- defines += [ "TARGET_OS_MACOS" ]
+ defines += [ "DART_TARGET_OS_MACOS" ]
} else if (target_os == "win") {
- defines += [ "TARGET_OS_WINDOWS" ]
+ defines += [ "DART_TARGET_OS_WINDOWS" ]
} else if (target_os == "winuwp") {
defines += [
- "TARGET_OS_WINDOWS",
- "TARGET_OS_WINDOWS_UWP",
+ "DART_TARGET_OS_WINDOWS",
+ "DART_TARGET_OS_WINDOWS_UWP",
]
} else {
print("Unknown target_os: $target_os")
@@ -98,7 +98,7 @@
# targeting Mac and Linux. This configuration is used to unconditionally target
# Fuchsia. It should not be combined with dart_os_config.
config("dart_os_fuchsia_config") {
- defines = [ "TARGET_OS_FUCHSIA" ]
+ defines = [ "DART_TARGET_OS_FUCHSIA" ]
}
config("dart_arch_config") {
diff --git a/runtime/bin/abstract_socket_test.cc b/runtime/bin/abstract_socket_test.cc
index 7af06b6..fab2f26 100644
--- a/runtime/bin/abstract_socket_test.cc
+++ b/runtime/bin/abstract_socket_test.cc
@@ -8,7 +8,7 @@
// closes the connection and UNIX socket.
#include "platform/globals.h"
-#if defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)
#include <stdio.h>
#include <stdlib.h>
@@ -101,4 +101,4 @@
return -1;
}
-#endif // defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)
diff --git a/runtime/bin/address_sanitizer.cc b/runtime/bin/address_sanitizer.cc
index 708e169..a780894 100644
--- a/runtime/bin/address_sanitizer.cc
+++ b/runtime/bin/address_sanitizer.cc
@@ -4,7 +4,7 @@
#include "platform/globals.h"
-#if defined(HOST_OS_LINUX) || defined(HOST_OS_MACOSX)
+#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOSX)
#if defined(__has_feature)
#if __has_feature(address_sanitizer)
@@ -23,4 +23,4 @@
#endif // __has_feature(address_sanitizer)
#endif // defined(__has_feature)
-#endif // defined(HOST_OS_LINUX) || defined(HOST_OS_MACOSX)
+#endif // defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOSX)
diff --git a/runtime/bin/console_posix.cc b/runtime/bin/console_posix.cc
index af28e15..17116da 100644
--- a/runtime/bin/console_posix.cc
+++ b/runtime/bin/console_posix.cc
@@ -3,8 +3,8 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_LINUX) || defined(HOST_OS_MACOS) || \
- defined(HOST_OS_ANDROID) || defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOS) || \
+ defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_FUCHSIA)
#include "bin/console.h"
@@ -88,5 +88,5 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_LINUX) || defined(HOST_OS_MACOS) ||
- // defined(HOST_OS_ANDROID) || defined(HOST_OS_FUCHSIA)
+#endif // defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOS) || \
+ // defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_FUCHSIA)
diff --git a/runtime/bin/console_win.cc b/runtime/bin/console_win.cc
index 6d7511a..59e6603 100644
--- a/runtime/bin/console_win.cc
+++ b/runtime/bin/console_win.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#include "bin/console.h"
#include "bin/file.h"
@@ -152,4 +152,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
diff --git a/runtime/bin/crashpad.cc b/runtime/bin/crashpad.cc
index 18ed3f5..d6d900c 100644
--- a/runtime/bin/crashpad.cc
+++ b/runtime/bin/crashpad.cc
@@ -21,7 +21,7 @@
namespace bin {
#if defined(DART_USE_CRASHPAD)
-#if !defined(HOST_OS_WINDOWS)
+#if !defined(DART_HOST_OS_WINDOWS)
#error "Currently we only support Crashpad on Windows"
#endif
diff --git a/runtime/bin/crypto_android.cc b/runtime/bin/crypto_android.cc
index 6db66eb..f8b1a9f 100644
--- a/runtime/bin/crypto_android.cc
+++ b/runtime/bin/crypto_android.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
#include <errno.h> // NOLINT
#include <fcntl.h> // NOLINT
@@ -41,4 +41,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_ANDROID)
diff --git a/runtime/bin/crypto_fuchsia.cc b/runtime/bin/crypto_fuchsia.cc
index c2fe425..a4623fe 100644
--- a/runtime/bin/crypto_fuchsia.cc
+++ b/runtime/bin/crypto_fuchsia.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
#include "bin/crypto.h"
@@ -20,4 +20,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_FUCHSIA)
+#endif // defined(DART_HOST_OS_FUCHSIA)
diff --git a/runtime/bin/crypto_linux.cc b/runtime/bin/crypto_linux.cc
index d3af9e0..957578e 100644
--- a/runtime/bin/crypto_linux.cc
+++ b/runtime/bin/crypto_linux.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_LINUX)
+#if defined(DART_HOST_OS_LINUX)
#include <errno.h> // NOLINT
#include <fcntl.h> // NOLINT
@@ -41,4 +41,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_LINUX)
+#endif // defined(DART_HOST_OS_LINUX)
diff --git a/runtime/bin/crypto_macos.cc b/runtime/bin/crypto_macos.cc
index b3afc6f..24dfe9b 100644
--- a/runtime/bin/crypto_macos.cc
+++ b/runtime/bin/crypto_macos.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_MACOS)
#include <errno.h> // NOLINT
#include <fcntl.h> // NOLINT
@@ -39,4 +39,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_MACOS)
+#endif // defined(DART_HOST_OS_MACOS)
diff --git a/runtime/bin/crypto_win.cc b/runtime/bin/crypto_win.cc
index 4233e98..fe72659 100644
--- a/runtime/bin/crypto_win.cc
+++ b/runtime/bin/crypto_win.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#include <bcrypt.h>
#include "bin/crypto.h"
@@ -28,4 +28,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
diff --git a/runtime/bin/dartutils.cc b/runtime/bin/dartutils.cc
index 7289341..9f60f2a 100644
--- a/runtime/bin/dartutils.cc
+++ b/runtime/bin/dartutils.cc
@@ -59,11 +59,11 @@
MagicNumberData gzip_magic_number = {2, {0x1f, 0x8b, 0, 0}};
static bool IsWindowsHost() {
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
return true;
-#else // defined(HOST_OS_WINDOWS)
+#else // defined(DART_HOST_OS_WINDOWS)
return false;
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
}
Dart_Handle CommandLineOptions::CreateRuntimeOptions() {
diff --git a/runtime/bin/dfe.cc b/runtime/bin/dfe.cc
index be5c249..a5710f1 100644
--- a/runtime/bin/dfe.cc
+++ b/runtime/bin/dfe.cc
@@ -140,7 +140,7 @@
}
PathSanitizer::PathSanitizer(const char* path) {
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
// For Windows we need to massage the paths a bit according to
// http://blogs.msdn.com/b/ie/archive/2006/12/06/file-uris-in-windows.aspx
//
@@ -169,15 +169,15 @@
sanitized_uri_ = std::unique_ptr<char[]>(uri);
#else
sanitized_uri_ = path;
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
}
const char* PathSanitizer::sanitized_uri() const {
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
return sanitized_uri_.get();
#else
return sanitized_uri_;
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
}
Dart_KernelCompilationResult DFE::CompileScript(const char* script_uri,
diff --git a/runtime/bin/dfe.h b/runtime/bin/dfe.h
index b381f9c..649cc32 100644
--- a/runtime/bin/dfe.h
+++ b/runtime/bin/dfe.h
@@ -138,11 +138,11 @@
const char* sanitized_uri() const;
private:
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
std::unique_ptr<char[]> sanitized_uri_;
#else
const char* sanitized_uri_;
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
DISALLOW_COPY_AND_ASSIGN(PathSanitizer);
};
diff --git a/runtime/bin/directory_android.cc b/runtime/bin/directory_android.cc
index 67e47df..27e0f01 100644
--- a/runtime/bin/directory_android.cc
+++ b/runtime/bin/directory_android.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
#include "bin/directory.h"
@@ -508,4 +508,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_ANDROID)
diff --git a/runtime/bin/directory_fuchsia.cc b/runtime/bin/directory_fuchsia.cc
index 4cbffbe..d37394a 100644
--- a/runtime/bin/directory_fuchsia.cc
+++ b/runtime/bin/directory_fuchsia.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
#include "bin/directory.h"
@@ -512,4 +512,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_FUCHSIA)
+#endif // defined(DART_HOST_OS_FUCHSIA)
diff --git a/runtime/bin/directory_linux.cc b/runtime/bin/directory_linux.cc
index 5321a9a..a1065e3 100644
--- a/runtime/bin/directory_linux.cc
+++ b/runtime/bin/directory_linux.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_LINUX)
+#if defined(DART_HOST_OS_LINUX)
#include "bin/directory.h"
@@ -506,4 +506,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_LINUX)
+#endif // defined(DART_HOST_OS_LINUX)
diff --git a/runtime/bin/directory_macos.cc b/runtime/bin/directory_macos.cc
index 7a884e9..cce2154 100644
--- a/runtime/bin/directory_macos.cc
+++ b/runtime/bin/directory_macos.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_MACOS)
#include "bin/directory.h"
@@ -446,4 +446,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_MACOS)
+#endif // defined(DART_HOST_OS_MACOS)
diff --git a/runtime/bin/directory_win.cc b/runtime/bin/directory_win.cc
index 16b0984..804bfff 100644
--- a/runtime/bin/directory_win.cc
+++ b/runtime/bin/directory_win.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#include "bin/directory.h"
@@ -531,4 +531,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
diff --git a/runtime/bin/elf_loader.cc b/runtime/bin/elf_loader.cc
index 22c2cbc..92d6685 100644
--- a/runtime/bin/elf_loader.cc
+++ b/runtime/bin/elf_loader.cc
@@ -10,7 +10,7 @@
#include <vm/cpu.h>
#include <vm/virtual_memory.h>
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
#include <sys/mman.h>
#endif
@@ -25,7 +25,7 @@
class Mappable {
public:
static Mappable* FromPath(const char* path);
-#if defined(HOST_OS_FUCHSIA) || defined(HOST_OS_LINUX)
+#if defined(DART_HOST_OS_FUCHSIA) || defined(DART_HOST_OS_LINUX)
static Mappable* FromFD(int fd);
#endif
static Mappable* FromMemory(const uint8_t* memory, size_t size);
@@ -151,7 +151,7 @@
return new FileMappable(File::Open(/*namespc=*/nullptr, path, File::kRead));
}
-#if defined(HOST_OS_FUCHSIA) || defined(HOST_OS_LINUX)
+#if defined(DART_HOST_OS_FUCHSIA) || defined(DART_HOST_OS_LINUX)
Mappable* Mappable::FromFD(int fd) {
return new FileMappable(File::OpenFD(fd));
}
@@ -424,7 +424,7 @@
ERROR("Unsupported segment flag set.");
}
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
// mmap is less flexible on Fuchsia than on Linux and Darwin, in (at least)
// two important ways:
//
@@ -546,7 +546,7 @@
using namespace dart::bin::elf; // NOLINT
-#if defined(HOST_OS_FUCHSIA) || defined(HOST_OS_LINUX)
+#if defined(DART_HOST_OS_FUCHSIA) || defined(DART_HOST_OS_LINUX)
DART_EXPORT Dart_LoadedElf* Dart_LoadELF_Fd(int fd,
uint64_t file_offset,
const char** error,
@@ -569,7 +569,7 @@
}
#endif
-#if !defined(HOST_OS_FUCHSIA)
+#if !defined(DART_HOST_OS_FUCHSIA)
DART_EXPORT Dart_LoadedElf* Dart_LoadELF(const char* filename,
uint64_t file_offset,
const char** error,
diff --git a/runtime/bin/entrypoints_verification_test_extension_dllmain_win.cc b/runtime/bin/entrypoints_verification_test_extension_dllmain_win.cc
index cbf42d5..8ff69ee 100644
--- a/runtime/bin/entrypoints_verification_test_extension_dllmain_win.cc
+++ b/runtime/bin/entrypoints_verification_test_extension_dllmain_win.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#define WIN32_LEAN_AND_MEAN
#include <windows.h> // NOLINT
@@ -12,4 +12,4 @@
return true;
}
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
diff --git a/runtime/bin/eventhandler.h b/runtime/bin/eventhandler.h
index b45deac..c6c8686 100644
--- a/runtime/bin/eventhandler.h
+++ b/runtime/bin/eventhandler.h
@@ -582,15 +582,15 @@
} // namespace dart
// The event handler delegation class is OS specific.
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
#include "bin/eventhandler_android.h"
-#elif defined(HOST_OS_FUCHSIA)
+#elif defined(DART_HOST_OS_FUCHSIA)
#include "bin/eventhandler_fuchsia.h"
-#elif defined(HOST_OS_LINUX)
+#elif defined(DART_HOST_OS_LINUX)
#include "bin/eventhandler_linux.h"
-#elif defined(HOST_OS_MACOS)
+#elif defined(DART_HOST_OS_MACOS)
#include "bin/eventhandler_macos.h"
-#elif defined(HOST_OS_WINDOWS)
+#elif defined(DART_HOST_OS_WINDOWS)
#include "bin/eventhandler_win.h"
#else
#error Unknown target os.
diff --git a/runtime/bin/eventhandler_android.cc b/runtime/bin/eventhandler_android.cc
index 958e5c3..b6dfc17 100644
--- a/runtime/bin/eventhandler_android.cc
+++ b/runtime/bin/eventhandler_android.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
#include "bin/eventhandler.h"
#include "bin/eventhandler_android.h"
@@ -432,4 +432,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_ANDROID)
diff --git a/runtime/bin/eventhandler_fuchsia.cc b/runtime/bin/eventhandler_fuchsia.cc
index f15bc3b..1f14ffb 100644
--- a/runtime/bin/eventhandler_fuchsia.cc
+++ b/runtime/bin/eventhandler_fuchsia.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
#include "bin/eventhandler.h"
#include "bin/eventhandler_fuchsia.h"
@@ -659,4 +659,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_FUCHSIA)
+#endif // defined(DART_HOST_OS_FUCHSIA)
diff --git a/runtime/bin/eventhandler_linux.cc b/runtime/bin/eventhandler_linux.cc
index 48ef4ef..ac9deb5 100644
--- a/runtime/bin/eventhandler_linux.cc
+++ b/runtime/bin/eventhandler_linux.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_LINUX)
+#if defined(DART_HOST_OS_LINUX)
#include "bin/eventhandler.h"
#include "bin/eventhandler_linux.h"
@@ -436,4 +436,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_LINUX)
+#endif // defined(DART_HOST_OS_LINUX)
diff --git a/runtime/bin/eventhandler_macos.cc b/runtime/bin/eventhandler_macos.cc
index 904ae0a..ee8f0fb 100644
--- a/runtime/bin/eventhandler_macos.cc
+++ b/runtime/bin/eventhandler_macos.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_MACOS)
#include "bin/eventhandler.h"
#include "bin/eventhandler_macos.h"
@@ -496,4 +496,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_MACOS)
+#endif // defined(DART_HOST_OS_MACOS)
diff --git a/runtime/bin/eventhandler_win.cc b/runtime/bin/eventhandler_win.cc
index 0de689a..abdba9a 100644
--- a/runtime/bin/eventhandler_win.cc
+++ b/runtime/bin/eventhandler_win.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#include "bin/eventhandler.h"
#include "bin/eventhandler_win.h"
@@ -1499,4 +1499,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
diff --git a/runtime/bin/exe_utils.cc b/runtime/bin/exe_utils.cc
index 22f7986..6066465 100644
--- a/runtime/bin/exe_utils.cc
+++ b/runtime/bin/exe_utils.cc
@@ -16,11 +16,11 @@
const char* sep,
intptr_t sep_length) {
return (strncmp(path, sep, sep_length) == 0
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
// TODO(aam): GetExecutableName doesn't work reliably on Windows,
|| *path == '/'
#endif
- );
+ ); // NOLINT
}
// Returns the directory portion of a given path.
diff --git a/runtime/bin/extensions_android.cc b/runtime/bin/extensions_android.cc
index 32c32a7..f8f153b 100644
--- a/runtime/bin/extensions_android.cc
+++ b/runtime/bin/extensions_android.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
#include <dlfcn.h> // NOLINT
#include "bin/extensions.h"
@@ -39,4 +39,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_ANDROID)
diff --git a/runtime/bin/extensions_fuchsia.cc b/runtime/bin/extensions_fuchsia.cc
index de71763..637533a 100644
--- a/runtime/bin/extensions_fuchsia.cc
+++ b/runtime/bin/extensions_fuchsia.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
#include "bin/extensions.h"
@@ -43,4 +43,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_FUCHSIA)
+#endif // defined(DART_HOST_OS_FUCHSIA)
diff --git a/runtime/bin/extensions_linux.cc b/runtime/bin/extensions_linux.cc
index e2359d0..d0f3d0f 100644
--- a/runtime/bin/extensions_linux.cc
+++ b/runtime/bin/extensions_linux.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_LINUX)
+#if defined(DART_HOST_OS_LINUX)
#include <dlfcn.h> // NOLINT
#include "bin/extensions.h"
@@ -39,4 +39,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_LINUX)
+#endif // defined(DART_HOST_OS_LINUX)
diff --git a/runtime/bin/extensions_macos.cc b/runtime/bin/extensions_macos.cc
index f5436a0..b5be677 100644
--- a/runtime/bin/extensions_macos.cc
+++ b/runtime/bin/extensions_macos.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_MACOS)
#include <dlfcn.h> // NOLINT
#include "bin/extensions.h"
@@ -39,4 +39,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_MACOS)
+#endif // defined(DART_HOST_OS_MACOS)
diff --git a/runtime/bin/extensions_win.cc b/runtime/bin/extensions_win.cc
index 23b4349..d17d843 100644
--- a/runtime/bin/extensions_win.cc
+++ b/runtime/bin/extensions_win.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#include "bin/extensions.h"
#include "bin/utils.h"
@@ -51,4 +51,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
diff --git a/runtime/bin/fdutils_android.cc b/runtime/bin/fdutils_android.cc
index de1fb6b..ad30d28 100644
--- a/runtime/bin/fdutils_android.cc
+++ b/runtime/bin/fdutils_android.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
#include "bin/fdutils.h"
@@ -139,4 +139,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_ANDROID)
diff --git a/runtime/bin/fdutils_fuchsia.cc b/runtime/bin/fdutils_fuchsia.cc
index eb40c73..f62e66c 100644
--- a/runtime/bin/fdutils_fuchsia.cc
+++ b/runtime/bin/fdutils_fuchsia.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
#include "bin/fdutils.h"
@@ -138,4 +138,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_FUCHSIA)
+#endif // defined(DART_HOST_OS_FUCHSIA)
diff --git a/runtime/bin/fdutils_linux.cc b/runtime/bin/fdutils_linux.cc
index 1caa786..f730ea6 100644
--- a/runtime/bin/fdutils_linux.cc
+++ b/runtime/bin/fdutils_linux.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_LINUX)
+#if defined(DART_HOST_OS_LINUX)
#include "bin/fdutils.h"
@@ -139,4 +139,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_LINUX)
+#endif // defined(DART_HOST_OS_LINUX)
diff --git a/runtime/bin/fdutils_macos.cc b/runtime/bin/fdutils_macos.cc
index 341e85f..a7b90e3 100644
--- a/runtime/bin/fdutils_macos.cc
+++ b/runtime/bin/fdutils_macos.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_MACOS)
#include "bin/fdutils.h"
@@ -139,4 +139,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_MACOS)
+#endif // defined(DART_HOST_OS_MACOS)
diff --git a/runtime/bin/ffi_test/ffi_test_functions_vmspecific.cc b/runtime/bin/ffi_test/ffi_test_functions_vmspecific.cc
index 8564aa6..a4ad2d5 100644
--- a/runtime/bin/ffi_test/ffi_test_functions_vmspecific.cc
+++ b/runtime/bin/ffi_test/ffi_test_functions_vmspecific.cc
@@ -11,7 +11,7 @@
#include "platform/globals.h"
#include "platform/memory_sanitizer.h"
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#include <psapi.h>
#include <windows.h>
#else
@@ -116,7 +116,7 @@
: 0;
}
-#if !defined(HOST_OS_WINDOWS)
+#if !defined(DART_HOST_OS_WINDOWS)
DART_EXPORT void* UnprotectCodeOtherThread(void* isolate,
std::condition_variable* var,
std::mutex* mut) {
@@ -185,7 +185,7 @@
// Clobbers some registers with special meaning in Dart before re-entry, for
// stress-testing. Not used on 32-bit Windows due to complications with Windows
// "safeseh".
-#if defined(TARGET_OS_WINDOWS) && defined(HOST_ARCH_IA32)
+#if defined(DART_TARGET_OS_WINDOWS) && defined(HOST_ARCH_IA32)
void ClobberAndCall(void (*fn)()) {
fn();
}
@@ -203,7 +203,7 @@
void (*callback)();
};
-#if defined(TARGET_OS_LINUX)
+#if defined(DART_TARGET_OS_LINUX)
thread_local sigjmp_buf buf;
void CallbackTestSignalHandler(int) {
@@ -312,13 +312,13 @@
#endif
}
-#endif // defined(TARGET_OS_LINUX)
+#endif // defined(DART_TARGET_OS_LINUX)
// Restore default SIGPIPE handler, which is only needed on mac
// since that is the only platform we explicitly ignore it.
// See Platform::Initialize() in platform_macos.cc.
DART_EXPORT void RestoreSIGPIPEHandler() {
-#if defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_MACOS)
signal(SIGPIPE, SIG_DFL);
#endif
}
@@ -428,7 +428,7 @@
#define FATAL(error) Fatal(__FILE__, __LINE__, error)
DART_EXPORT void SleepOnAnyOS(intptr_t seconds) {
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
Sleep(1000 * seconds);
#else
sleep(seconds);
diff --git a/runtime/bin/ffi_unit_test/BUILD.gn b/runtime/bin/ffi_unit_test/BUILD.gn
index 2a7b371..99396af 100644
--- a/runtime/bin/ffi_unit_test/BUILD.gn
+++ b/runtime/bin/ffi_unit_test/BUILD.gn
@@ -50,25 +50,23 @@
}
config("define_target_os_android") {
- defines = [ "TARGET_OS_ANDROID" ]
+ defines = [ "DART_TARGET_OS_ANDROID" ]
}
config("define_target_os_ios") {
- # This is TARGET_OS_MACOS_IOS instead of TARGET_OS_IOS because the latter is
- # defined by Xcode already. See https://dartbug.com/24453.
- defines = [ "TARGET_OS_MACOS_IOS" ]
+ defines = [ "DART_TARGET_OS_MACOS_IOS" ]
}
config("define_target_os_linux") {
- defines = [ "TARGET_OS_LINUX" ]
+ defines = [ "DART_TARGET_OS_LINUX" ]
}
config("define_target_os_macos") {
- defines = [ "TARGET_OS_MACOS" ]
+ defines = [ "DART_TARGET_OS_MACOS" ]
}
config("define_target_os_windows") {
- defines = [ "TARGET_OS_WINDOWS" ]
+ defines = [ "DART_TARGET_OS_WINDOWS" ]
}
build_run_ffi_unit_tests("run_ffi_unit_tests_arm_android") {
diff --git a/runtime/bin/file.h b/runtime/bin/file.h
index 98d3748..edeb388 100644
--- a/runtime/bin/file.h
+++ b/runtime/bin/file.h
@@ -221,7 +221,7 @@
// (stdin, stout or stderr).
static File* OpenStdio(int fd);
-#if defined(HOST_OS_FUCHSIA) || defined(HOST_OS_LINUX)
+#if defined(DART_HOST_OS_FUCHSIA) || defined(DART_HOST_OS_LINUX)
static File* OpenFD(int fd);
#endif
diff --git a/runtime/bin/file_android.cc b/runtime/bin/file_android.cc
index 0990227..b1e9bb0 100644
--- a/runtime/bin/file_android.cc
+++ b/runtime/bin/file_android.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
#include "bin/file.h"
@@ -748,4 +748,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_ANDROID)
diff --git a/runtime/bin/file_fuchsia.cc b/runtime/bin/file_fuchsia.cc
index b466119..aa7f882 100644
--- a/runtime/bin/file_fuchsia.cc
+++ b/runtime/bin/file_fuchsia.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
#include "bin/file.h"
@@ -704,4 +704,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_FUCHSIA)
+#endif // defined(DART_HOST_OS_FUCHSIA)
diff --git a/runtime/bin/file_linux.cc b/runtime/bin/file_linux.cc
index 79c084c..625f054 100644
--- a/runtime/bin/file_linux.cc
+++ b/runtime/bin/file_linux.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_LINUX)
+#if defined(DART_HOST_OS_LINUX)
#include "bin/file.h"
@@ -745,4 +745,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_LINUX)
+#endif // defined(DART_HOST_OS_LINUX)
diff --git a/runtime/bin/file_macos.cc b/runtime/bin/file_macos.cc
index fc546c3..8fa3cd7 100644
--- a/runtime/bin/file_macos.cc
+++ b/runtime/bin/file_macos.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_MACOS)
#include "bin/file.h"
@@ -650,4 +650,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_MACOS)
+#endif // defined(DART_HOST_OS_MACOS)
diff --git a/runtime/bin/file_system_watcher_android.cc b/runtime/bin/file_system_watcher_android.cc
index 0ff4c42..e163441 100644
--- a/runtime/bin/file_system_watcher_android.cc
+++ b/runtime/bin/file_system_watcher_android.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
#include "bin/file_system_watcher.h"
@@ -152,4 +152,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_ANDROID)
diff --git a/runtime/bin/file_system_watcher_fuchsia.cc b/runtime/bin/file_system_watcher_fuchsia.cc
index d898542..f6defa2 100644
--- a/runtime/bin/file_system_watcher_fuchsia.cc
+++ b/runtime/bin/file_system_watcher_fuchsia.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
#include "bin/file_system_watcher.h"
@@ -48,4 +48,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_FUCHSIA)
+#endif // defined(DART_HOST_OS_FUCHSIA)
diff --git a/runtime/bin/file_system_watcher_linux.cc b/runtime/bin/file_system_watcher_linux.cc
index fa48290..14c18d2 100644
--- a/runtime/bin/file_system_watcher_linux.cc
+++ b/runtime/bin/file_system_watcher_linux.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_LINUX)
+#if defined(DART_HOST_OS_LINUX)
#include "bin/file_system_watcher.h"
@@ -146,4 +146,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_LINUX)
+#endif // defined(DART_HOST_OS_LINUX)
diff --git a/runtime/bin/file_system_watcher_macos.cc b/runtime/bin/file_system_watcher_macos.cc
index 2cde121..1ccf753 100644
--- a/runtime/bin/file_system_watcher_macos.cc
+++ b/runtime/bin/file_system_watcher_macos.cc
@@ -3,11 +3,11 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_MACOS)
#include "bin/file_system_watcher.h"
-#if !HOST_OS_IOS
+#if !DART_HOST_OS_IOS
#include <CoreServices/CoreServices.h> // NOLINT
#include <errno.h> // NOLINT
@@ -350,7 +350,7 @@
} // namespace bin
} // namespace dart
-#else // !HOST_OS_IOS
+#else // !DART_HOST_OS_IOS
namespace dart {
namespace bin {
@@ -387,5 +387,5 @@
} // namespace bin
} // namespace dart
-#endif // !HOST_OS_IOS
-#endif // defined(HOST_OS_MACOS)
+#endif // !DART_HOST_OS_IOS
+#endif // defined(DART_HOST_OS_MACOS)
diff --git a/runtime/bin/file_system_watcher_win.cc b/runtime/bin/file_system_watcher_win.cc
index b371363..3598f51 100644
--- a/runtime/bin/file_system_watcher_win.cc
+++ b/runtime/bin/file_system_watcher_win.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#include "bin/file_system_watcher.h"
@@ -132,4 +132,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
diff --git a/runtime/bin/file_win.cc b/runtime/bin/file_win.cc
index 6e11076..b7f5dbe 100644
--- a/runtime/bin/file_win.cc
+++ b/runtime/bin/file_win.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#include <functional>
#include <memory>
@@ -1128,4 +1128,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
diff --git a/runtime/bin/io_buffer.cc b/runtime/bin/io_buffer.cc
index 1d53005..f10e55c 100644
--- a/runtime/bin/io_buffer.cc
+++ b/runtime/bin/io_buffer.cc
@@ -44,7 +44,7 @@
}
return buffer;
}
-#if defined(TARGET_OS_WINDOWS)
+#if defined(DART_TARGET_OS_WINDOWS)
// It seems windows realloc() doesn't free memory when shrinking, so we'll
// manually allocate a new buffer, copy the data and free the old buffer.
auto new_buffer = IOBuffer::Allocate(new_size);
diff --git a/runtime/bin/main_options.cc b/runtime/bin/main_options.cc
index faf1d5c..108fc91 100644
--- a/runtime/bin/main_options.cc
+++ b/runtime/bin/main_options.cc
@@ -225,13 +225,13 @@
"--root-certs-cache=<path>\n"
" The path to a cache directory containing the trusted root certificates to\n"
" use for secure socket connections.\n"
-#if defined(HOST_OS_LINUX) || \
- defined(HOST_OS_ANDROID) || \
- defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_LINUX) || \
+ defined(DART_HOST_OS_ANDROID) || \
+ defined(DART_HOST_OS_FUCHSIA)
"--namespace=<path>\n"
" The path to a directory that dart:io calls will treat as the root of the\n"
" filesystem.\n"
-#endif // defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)
"\n"
"The following options are only used for VM development and may\n"
"be changed in any future version:\n");
diff --git a/runtime/bin/namespace_android.cc b/runtime/bin/namespace_android.cc
index f5a2a9f..26fe976 100644
--- a/runtime/bin/namespace_android.cc
+++ b/runtime/bin/namespace_android.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
#include "bin/namespace.h"
@@ -156,4 +156,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_ANDROID)
diff --git a/runtime/bin/namespace_fuchsia.cc b/runtime/bin/namespace_fuchsia.cc
index c8cfbcb..87a50aa 100644
--- a/runtime/bin/namespace_fuchsia.cc
+++ b/runtime/bin/namespace_fuchsia.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
#include "bin/namespace.h"
#include "bin/namespace_fuchsia.h"
@@ -167,4 +167,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_FUCHSIA)
+#endif // defined(DART_HOST_OS_FUCHSIA)
diff --git a/runtime/bin/namespace_fuchsia.h b/runtime/bin/namespace_fuchsia.h
index ef1fff2..49d2a7c 100644
--- a/runtime/bin/namespace_fuchsia.h
+++ b/runtime/bin/namespace_fuchsia.h
@@ -6,7 +6,7 @@
#define RUNTIME_BIN_NAMESPACE_FUCHSIA_H_
#include "platform/globals.h"
-#if !defined(HOST_OS_FUCHSIA)
+#if !defined(DART_HOST_OS_FUCHSIA)
#error "This header file should only be included when targeting Fuchsia."
#endif
diff --git a/runtime/bin/namespace_linux.cc b/runtime/bin/namespace_linux.cc
index 416ea3d..c3d6d7f 100644
--- a/runtime/bin/namespace_linux.cc
+++ b/runtime/bin/namespace_linux.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_LINUX)
+#if defined(DART_HOST_OS_LINUX)
#include "bin/namespace.h"
@@ -156,4 +156,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_LINUX)
+#endif // defined(DART_HOST_OS_LINUX)
diff --git a/runtime/bin/namespace_macos.cc b/runtime/bin/namespace_macos.cc
index f6e55c1..32b8eed 100644
--- a/runtime/bin/namespace_macos.cc
+++ b/runtime/bin/namespace_macos.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_MACOS)
#include "bin/namespace.h"
@@ -64,4 +64,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_MACOS)
+#endif // defined(DART_HOST_OS_MACOS)
diff --git a/runtime/bin/namespace_win.cc b/runtime/bin/namespace_win.cc
index 09a05f5..c654d41 100644
--- a/runtime/bin/namespace_win.cc
+++ b/runtime/bin/namespace_win.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#include "bin/namespace.h"
@@ -74,4 +74,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
diff --git a/runtime/bin/platform.h b/runtime/bin/platform.h
index 0a7db28..bf2d6b1 100644
--- a/runtime/bin/platform.h
+++ b/runtime/bin/platform.h
@@ -9,9 +9,9 @@
#include "platform/globals.h"
#include "platform/utils.h"
-#if defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_MACOS)
#include "bin/platform_macos.h"
-#endif // defined(HOST_OS_MACOS)
+#endif // defined(DART_HOST_OS_MACOS)
namespace dart {
namespace bin {
diff --git a/runtime/bin/platform_android.cc b/runtime/bin/platform_android.cc
index 6555965..6e5a34a 100644
--- a/runtime/bin/platform_android.cc
+++ b/runtime/bin/platform_android.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
#include "bin/platform.h"
@@ -173,4 +173,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_ANDROID)
diff --git a/runtime/bin/platform_fuchsia.cc b/runtime/bin/platform_fuchsia.cc
index 3fa55be..5c23480 100644
--- a/runtime/bin/platform_fuchsia.cc
+++ b/runtime/bin/platform_fuchsia.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
#include "bin/platform.h"
@@ -164,4 +164,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_FUCHSIA)
+#endif // defined(DART_HOST_OS_FUCHSIA)
diff --git a/runtime/bin/platform_linux.cc b/runtime/bin/platform_linux.cc
index e6571af..d9443bb 100644
--- a/runtime/bin/platform_linux.cc
+++ b/runtime/bin/platform_linux.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_LINUX)
+#if defined(DART_HOST_OS_LINUX)
#include "bin/platform.h"
@@ -180,4 +180,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_LINUX)
+#endif // defined(DART_HOST_OS_LINUX)
diff --git a/runtime/bin/platform_macos.cc b/runtime/bin/platform_macos.cc
index f7c4c8c..0479776 100644
--- a/runtime/bin/platform_macos.cc
+++ b/runtime/bin/platform_macos.cc
@@ -3,16 +3,16 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_MACOS)
#include "bin/platform.h"
#include "bin/platform_macos.h"
#include <CoreFoundation/CoreFoundation.h>
-#if !HOST_OS_IOS
+#if !DART_HOST_OS_IOS
#include <crt_externs.h> // NOLINT
-#endif // !HOST_OS_IOS
+#endif // !DART_HOST_OS_IOS
#include <errno.h> // NOLINT
#include <mach-o/dyld.h>
#include <signal.h> // NOLINT
@@ -107,7 +107,7 @@
}
const char* Platform::OperatingSystem() {
-#if HOST_OS_IOS
+#if DART_HOST_OS_IOS
return "ios";
#else
return "macos";
@@ -262,7 +262,7 @@
}
char** Platform::Environment(intptr_t* count) {
-#if HOST_OS_IOS
+#if DART_HOST_OS_IOS
// TODO(zra,chinmaygarde): On iOS, environment variables are seldom used. Wire
// this up if someone needs it. In the meantime, we return an empty array.
char** result;
@@ -343,4 +343,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_MACOS)
+#endif // defined(DART_HOST_OS_MACOS)
diff --git a/runtime/bin/platform_macos_test.cc b/runtime/bin/platform_macos_test.cc
index 052d541..3c37901 100644
--- a/runtime/bin/platform_macos_test.cc
+++ b/runtime/bin/platform_macos_test.cc
@@ -2,7 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-#if defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_MACOS)
#include "bin/platform.h"
#include "vm/unit_test.h"
@@ -50,4 +50,4 @@
}
} // namespace dart
-#endif // defined(HOST_OS_MACOS)
+#endif // defined(DART_HOST_OS_MACOS)
diff --git a/runtime/bin/platform_win.cc b/runtime/bin/platform_win.cc
index 552e3c2..59e1b74 100644
--- a/runtime/bin/platform_win.cc
+++ b/runtime/bin/platform_win.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#include "bin/platform.h"
@@ -319,4 +319,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
diff --git a/runtime/bin/process.h b/runtime/bin/process.h
index cf141b2..5a6adfd 100644
--- a/runtime/bin/process.h
+++ b/runtime/bin/process.h
@@ -13,7 +13,7 @@
#include "bin/namespace.h"
#include "bin/thread.h"
#include "platform/globals.h"
-#if !defined(HOST_OS_WINDOWS)
+#if !defined(DART_HOST_OS_WINDOWS)
#include "platform/signal_blocker.h"
#endif
#include "platform/utils.h"
@@ -348,8 +348,8 @@
DISALLOW_COPY_AND_ASSIGN(BufferListBase);
};
-#if defined(HOST_OS_ANDROID) || defined(HOST_OS_FUCHSIA) || \
- defined(HOST_OS_LINUX) || defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_FUCHSIA) || \
+ defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOS)
class BufferList : public BufferListBase {
public:
BufferList() {}
@@ -366,13 +366,13 @@
ASSERT(free_size() > 0);
ASSERT(free_size() <= kBufferSize);
intptr_t block_size = dart::Utils::Minimum(free_size(), available);
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
intptr_t bytes = NO_RETRY_EXPECTED(
read(fd, reinterpret_cast<void*>(FreeSpaceAddress()), block_size));
#else
intptr_t bytes = TEMP_FAILURE_RETRY(
read(fd, reinterpret_cast<void*>(FreeSpaceAddress()), block_size));
-#endif // defined(HOST_OS_FUCHSIA)
+#endif // defined(DART_HOST_OS_FUCHSIA)
if (bytes < 0) {
return false;
}
@@ -386,7 +386,7 @@
private:
DISALLOW_COPY_AND_ASSIGN(BufferList);
};
-#endif // defined(HOST_OS_ANDROID) ...
+#endif // defined(DART_HOST_OS_ANDROID) ...
} // namespace bin
} // namespace dart
diff --git a/runtime/bin/process_android.cc b/runtime/bin/process_android.cc
index 700de02..874d99a 100644
--- a/runtime/bin/process_android.cc
+++ b/runtime/bin/process_android.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
#include "bin/process.h"
@@ -1159,4 +1159,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_ANDROID)
diff --git a/runtime/bin/process_fuchsia.cc b/runtime/bin/process_fuchsia.cc
index f5495d8..f87c28c 100644
--- a/runtime/bin/process_fuchsia.cc
+++ b/runtime/bin/process_fuchsia.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
#include "bin/process.h"
@@ -867,4 +867,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_FUCHSIA)
+#endif // defined(DART_HOST_OS_FUCHSIA)
diff --git a/runtime/bin/process_linux.cc b/runtime/bin/process_linux.cc
index d1897fa..c20649e 100644
--- a/runtime/bin/process_linux.cc
+++ b/runtime/bin/process_linux.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_LINUX)
+#if defined(DART_HOST_OS_LINUX)
#include "bin/process.h"
@@ -1155,4 +1155,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_LINUX)
+#endif // defined(DART_HOST_OS_LINUX)
diff --git a/runtime/bin/process_macos.cc b/runtime/bin/process_macos.cc
index 78a84ba..f20c589 100644
--- a/runtime/bin/process_macos.cc
+++ b/runtime/bin/process_macos.cc
@@ -3,11 +3,11 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_MACOS)
#include "bin/process.h"
-#if !HOST_OS_IOS
+#if !DART_HOST_OS_IOS
#include <crt_externs.h> // NOLINT
#endif
#include <errno.h> // NOLINT
@@ -468,7 +468,7 @@
ReportChildError();
}
-#if !HOST_OS_IOS
+#if !DART_HOST_OS_IOS
if (program_environment_ != NULL) {
// On MacOS you have to do a bit of magic to get to the
// environment strings.
@@ -521,7 +521,7 @@
(TEMP_FAILURE_RETRY(chdir(working_directory_)) == -1)) {
ReportChildError();
}
-#if !HOST_OS_IOS
+#if !DART_HOST_OS_IOS
if (program_environment_ != NULL) {
// On MacOS you have to do a bit of magic to get to the
// environment strings.
@@ -1191,4 +1191,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_MACOS)
+#endif // defined(DART_HOST_OS_MACOS)
diff --git a/runtime/bin/process_win.cc b/runtime/bin/process_win.cc
index 3567d21..1e3a02c 100644
--- a/runtime/bin/process_win.cc
+++ b/runtime/bin/process_win.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#include "bin/process.h"
@@ -935,7 +935,7 @@
// https://docs.microsoft.com/en-us/windows/win32/api/psapi/nf-psapi-getprocessmemoryinfo
// claims that GetProcessMemoryInfo is UWP compatible, it is actually not
// hence this function cannot work when compiled in UWP mode.
-#ifdef TARGET_OS_WINDOWS_UWP
+#ifdef DART_TARGET_OS_WINDOWS_UWP
return -1;
#else
PROCESS_MEMORY_COUNTERS pmc;
@@ -947,7 +947,7 @@
}
int64_t Process::MaxRSS() {
-#ifdef TARGET_OS_WINDOWS_UWP
+#ifdef DART_TARGET_OS_WINDOWS_UWP
return -1;
#else
PROCESS_MEMORY_COUNTERS pmc;
@@ -1140,4 +1140,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
diff --git a/runtime/bin/root_certificates_unsupported.cc b/runtime/bin/root_certificates_unsupported.cc
index e644665..400877c 100644
--- a/runtime/bin/root_certificates_unsupported.cc
+++ b/runtime/bin/root_certificates_unsupported.cc
@@ -5,7 +5,7 @@
#if !defined(DART_IO_SECURE_SOCKET_DISABLED)
#include "platform/globals.h"
-#if defined(HOST_OS_MACOS) || defined(HOST_OS_ANDROID) || \
+#if defined(DART_HOST_OS_MACOS) || defined(DART_HOST_OS_ANDROID) || \
defined(DART_IO_ROOT_CERTS_DISABLED)
namespace dart {
@@ -17,6 +17,6 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_MACOS) || defined(HOST_OS_ANDROID) || ...
+#endif // defined(DART_HOST_OS_MACOS) || defined(DART_HOST_OS_ANDROID) || ...
#endif // !defined(DART_IO_SECURE_SOCKET_DISABLED)
diff --git a/runtime/bin/secure_socket_filter.cc b/runtime/bin/secure_socket_filter.cc
index f515b92..efaa417 100644
--- a/runtime/bin/secure_socket_filter.cc
+++ b/runtime/bin/secure_socket_filter.cc
@@ -161,7 +161,7 @@
Dart_NativeArguments args) {
// This is to be used only in conjunction with certificate trust evaluator
// running asynchronously, which is only used on mac/ios at the moment.
-#if !defined(HOST_OS_MACOS)
+#if !defined(DART_HOST_OS_MACOS)
FATAL("This is to be used only on mac/ios platforms");
#endif
intptr_t x509_pointer = DartUtils::GetNativeIntptrArgument(args, 0);
diff --git a/runtime/bin/security_context_android.cc b/runtime/bin/security_context_android.cc
index e0e9378..9f39a18 100644
--- a/runtime/bin/security_context_android.cc
+++ b/runtime/bin/security_context_android.cc
@@ -5,7 +5,7 @@
#if !defined(DART_IO_SECURE_SOCKET_DISABLED)
#include "platform/globals.h"
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
#include "bin/security_context.h"
@@ -64,6 +64,6 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_ANDROID)
#endif // !defined(DART_IO_SECURE_SOCKET_DISABLED)
diff --git a/runtime/bin/security_context_fuchsia.cc b/runtime/bin/security_context_fuchsia.cc
index e8f2f7a..35eba79 100644
--- a/runtime/bin/security_context_fuchsia.cc
+++ b/runtime/bin/security_context_fuchsia.cc
@@ -5,7 +5,7 @@
#if !defined(DART_IO_SECURE_SOCKET_DISABLED)
#include "platform/globals.h"
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
#include "bin/security_context.h"
@@ -57,6 +57,6 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_FUCHSIA)
+#endif // defined(DART_HOST_OS_FUCHSIA)
#endif // !defined(DART_IO_SECURE_SOCKET_DISABLED)
diff --git a/runtime/bin/security_context_linux.cc b/runtime/bin/security_context_linux.cc
index b251a0a..b940c75 100644
--- a/runtime/bin/security_context_linux.cc
+++ b/runtime/bin/security_context_linux.cc
@@ -5,7 +5,7 @@
#if !defined(DART_IO_SECURE_SOCKET_DISABLED)
#include "platform/globals.h"
-#if defined(HOST_OS_LINUX)
+#if defined(DART_HOST_OS_LINUX)
#include "bin/security_context.h"
@@ -83,6 +83,6 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_LINUX)
+#endif // defined(DART_HOST_OS_LINUX)
#endif // !defined(DART_IO_SECURE_SOCKET_DISABLED)
diff --git a/runtime/bin/security_context_macos.cc b/runtime/bin/security_context_macos.cc
index 1cba22d..410a33b 100644
--- a/runtime/bin/security_context_macos.cc
+++ b/runtime/bin/security_context_macos.cc
@@ -5,7 +5,7 @@
#if !defined(DART_IO_SECURE_SOCKET_DISABLED)
#include "platform/globals.h"
-#if defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_MACOS)
#include "bin/security_context.h"
@@ -347,6 +347,6 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_MACOS)
+#endif // defined(DART_HOST_OS_MACOS)
#endif // !defined(DART_IO_SECURE_SOCKET_DISABLED)
diff --git a/runtime/bin/security_context_win.cc b/runtime/bin/security_context_win.cc
index 6b19a89..f61ae55 100644
--- a/runtime/bin/security_context_win.cc
+++ b/runtime/bin/security_context_win.cc
@@ -5,7 +5,7 @@
#if !defined(DART_IO_SECURE_SOCKET_DISABLED)
#include "platform/globals.h"
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#include "bin/security_context.h"
@@ -20,7 +20,7 @@
#include "bin/secure_socket_utils.h"
#include "platform/syslog.h"
-#ifndef TARGET_OS_WINDOWS_UWP
+#ifndef DART_TARGET_OS_WINDOWS_UWP
#pragma comment(lib, "crypt32.lib")
#endif
@@ -42,7 +42,7 @@
Syslog::PrintErr("%s %s\n", str, error_string);
}
-#ifndef TARGET_OS_WINDOWS_UWP
+#ifndef DART_TARGET_OS_WINDOWS_UWP
static bool AddCertificatesFromNamedSystemStore(const wchar_t* name,
DWORD store_type,
X509_STORE* store) {
@@ -158,13 +158,13 @@
}
return true;
}
-#endif // ifdef TARGET_OS_WINDOWS_UWP
+#endif // ifdef DART_TARGET_OS_WINDOWS_UWP
// Add certificates from Windows trusted root store.
static bool AddCertificatesFromRootStore(X509_STORE* store) {
// The UWP platform doesn't support CertEnumCertificatesInStore hence
// this function cannot work when compiled in UWP mode.
-#ifdef TARGET_OS_WINDOWS_UWP
+#ifdef DART_TARGET_OS_WINDOWS_UWP
return false;
#else
if (!AddCertificatesFromSystemStore(CERT_SYSTEM_STORE_CURRENT_USER, store)) {
@@ -176,7 +176,7 @@
}
return true;
-#endif // ifdef TARGET_OS_WINDOWS_UWP
+#endif // ifdef DART_TARGET_OS_WINDOWS_UWP
}
void SSLCertContext::TrustBuiltinRoots() {
@@ -226,6 +226,6 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
#endif // !defined(DART_IO_SECURE_SOCKET_DISABLED)
diff --git a/runtime/bin/snapshot_utils.cc b/runtime/bin/snapshot_utils.cc
index 5168ac5..7361612 100644
--- a/runtime/bin/snapshot_utils.cc
+++ b/runtime/bin/snapshot_utils.cc
@@ -201,7 +201,7 @@
*isolate_data_buffer = nullptr,
*isolate_instructions_buffer = nullptr;
Dart_LoadedElf* handle = nullptr;
-#if !defined(HOST_OS_FUCHSIA)
+#if !defined(DART_HOST_OS_FUCHSIA)
if (force_load_elf_from_memory) {
#endif
File* const file =
@@ -218,7 +218,7 @@
&isolate_data_buffer, &isolate_instructions_buffer);
delete memory;
file->Release();
-#if !defined(HOST_OS_FUCHSIA)
+#if !defined(DART_HOST_OS_FUCHSIA)
} else {
handle = Dart_LoadELF(script_name, file_offset, &error, &vm_data_buffer,
&vm_instructions_buffer, &isolate_data_buffer,
@@ -349,7 +349,7 @@
// For testing AOT with the standalone embedder, we also support loading
// from a dynamic library to simulate what happens on iOS.
-#if defined(TARGET_OS_LINUX) || defined(TARGET_OS_MACOS)
+#if defined(DART_TARGET_OS_LINUX) || defined(DART_TARGET_OS_MACOS)
// On Linux and OSX, resolve the script path before passing into dlopen()
// since dlopen will not search the filesystem for paths like 'libtest.so'.
std::unique_ptr<char, decltype(std::free)*> absolute_path{
diff --git a/runtime/bin/socket.cc b/runtime/bin/socket.cc
index 1e137db..ec52dad 100644
--- a/runtime/bin/socket.cc
+++ b/runtime/bin/socket.cc
@@ -208,12 +208,12 @@
return result;
}
-#if defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)
// Abstract unix domain socket doesn't exist in file system.
if (File::Exists(namespc, addr.un.sun_path) && path[0] != '@') {
#else
if (File::Exists(namespc, addr.un.sun_path)) {
-#endif // defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)
if (unix_domain_sockets_ != nullptr) {
// If there is a socket listening on this file. Ensure
// that it was created with `shared` mode and current `shared`
@@ -285,7 +285,7 @@
}
// Unlink the socket file, if os_socket contains unix domain sockets.
if (os_socket->address.addr.sa_family == AF_UNIX) {
-#if defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)
// If the socket is abstract, which has a path starting with a null byte,
// unlink() is not necessary because the file doesn't exist.
if (os_socket->address.un.sun_path[0] != '\0') {
@@ -293,7 +293,7 @@
}
#else
Utils::Unlink(os_socket->address.un.sun_path);
-#endif // defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)
// Remove os_socket from unix_domain_sockets_ list.
OSSocket* prev = nullptr;
OSSocket* current = unix_domain_sockets_;
@@ -409,7 +409,7 @@
void FUNCTION_NAME(Socket_CreateUnixDomainBindConnect)(
Dart_NativeArguments args) {
-#if defined(HOST_OS_WINDOWS) || defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_WINDOWS) || defined(DART_HOST_OS_FUCHSIA)
OSError os_error(
-1, "Unix domain sockets are not available on this operating system.",
OSError::kUnknown);
@@ -450,11 +450,11 @@
} else {
Dart_SetReturnValue(args, DartUtils::NewDartOSError());
}
-#endif // defined(HOST_OS_WINDOWS) || defined(HOST_OS_FUCHSIA)
+#endif // defined(DART_HOST_OS_WINDOWS) || defined(DART_HOST_OS_FUCHSIA)
}
void FUNCTION_NAME(Socket_CreateUnixDomainConnect)(Dart_NativeArguments args) {
-#if defined(HOST_OS_WINDOWS) || defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_WINDOWS) || defined(DART_HOST_OS_FUCHSIA)
OSError os_error(
-1, "Unix domain sockets are not available on this operating system.",
OSError::kUnknown);
@@ -481,7 +481,7 @@
} else {
Dart_SetReturnValue(args, DartUtils::NewDartOSError());
}
-#endif // defined(HOST_OS_WINDOWS) || defined(HOST_OS_FUCHSIA)
+#endif // defined(DART_HOST_OS_WINDOWS) || defined(DART_HOST_OS_FUCHSIA)
}
void FUNCTION_NAME(Socket_CreateBindDatagram)(Dart_NativeArguments args) {
@@ -855,7 +855,7 @@
void FUNCTION_NAME(ServerSocket_CreateUnixDomainBindListen)(
Dart_NativeArguments args) {
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
OSError os_error(
-1, "Unix domain sockets are not available on this operating system.",
OSError::kUnknown);
@@ -876,7 +876,7 @@
ListeningSocketRegistry::Instance()->CreateUnixDomainBindListen(
socket_object, namespc, path, backlog, shared);
Dart_SetReturnValue(args, result);
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
}
void FUNCTION_NAME(ServerSocket_Accept)(Dart_NativeArguments args) {
diff --git a/runtime/bin/socket.h b/runtime/bin/socket.h
index d7fc972..b0efe34 100644
--- a/runtime/bin/socket.h
+++ b/runtime/bin/socket.h
@@ -262,7 +262,7 @@
const char* path) {
while (current != NULL) {
ASSERT(current->address.addr.sa_family == AF_UNIX);
-#if defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)
bool condition;
if (path[0] == '\0') {
condition = current->address.un.sun_path[0] == '\0' &&
@@ -280,7 +280,7 @@
namespc, path) == File::kIdentical) {
return current;
}
-#endif // defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)
current = current->next;
}
return NULL;
diff --git a/runtime/bin/socket_android.cc b/runtime/bin/socket_android.cc
index 196cb36..deddbd2 100644
--- a/runtime/bin/socket_android.cc
+++ b/runtime/bin/socket_android.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
#include "bin/socket.h"
@@ -280,4 +280,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_ANDROID)
diff --git a/runtime/bin/socket_base.cc b/runtime/bin/socket_base.cc
index d97ced4..482163e 100644
--- a/runtime/bin/socket_base.cc
+++ b/runtime/bin/socket_base.cc
@@ -128,7 +128,7 @@
Dart_Handle SocketAddress::GetUnixDomainSockAddr(const char* path,
Namespace* namespc,
RawAddr* addr) {
-#if defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)
NamespaceScope ns(namespc, path);
path = ns.path();
bool is_abstract = (path[0] == '@');
@@ -139,7 +139,7 @@
// connection will be rejected.
bzero(addr->un.sun_path, sizeof(addr->un.sun_path));
}
-#endif // defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)
if (sizeof(path) > sizeof(addr->un.sun_path)) {
OSError os_error(-1,
"The length of path exceeds the limit. "
@@ -149,12 +149,12 @@
}
addr->un.sun_family = AF_UNIX;
Utils::SNPrint(addr->un.sun_path, sizeof(addr->un.sun_path), "%s", path);
-#if defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)
// In case of abstract namespace, transfer the leading '@' into a null byte.
if (is_abstract) {
addr->un.sun_path[0] = '\0';
}
-#endif // defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)
return Dart_Null();
}
diff --git a/runtime/bin/socket_base.h b/runtime/bin/socket_base.h
index 07ee42e..0442e5b 100644
--- a/runtime/bin/socket_base.h
+++ b/runtime/bin/socket_base.h
@@ -7,15 +7,15 @@
#include "platform/globals.h"
// Declare the OS-specific types ahead of defining the generic class.
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
#include "bin/socket_base_android.h"
-#elif defined(HOST_OS_FUCHSIA)
+#elif defined(DART_HOST_OS_FUCHSIA)
#include "bin/socket_base_fuchsia.h"
-#elif defined(HOST_OS_LINUX)
+#elif defined(DART_HOST_OS_LINUX)
#include "bin/socket_base_linux.h"
-#elif defined(HOST_OS_MACOS)
+#elif defined(DART_HOST_OS_MACOS)
#include "bin/socket_base_macos.h"
-#elif defined(HOST_OS_WINDOWS)
+#elif defined(DART_HOST_OS_WINDOWS)
#include "bin/socket_base_win.h"
#else
#error Unknown target os.
@@ -86,7 +86,8 @@
static intptr_t GetAddrScope(const RawAddr& addr);
private:
-#if defined(HOST_OS_LINUX) || defined(HOST_OS_MACOS) || defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOS) || \
+ defined(DART_HOST_OS_ANDROID)
// Unix domain address is only on Linux, Mac OS and Android now.
// unix(7) require sun_path to be 108 bytes on Linux and Android, 104 bytes on
// Mac OS.
@@ -95,8 +96,8 @@
char as_string_[kMaxUnixPathLength];
#else
char as_string_[INET6_ADDRSTRLEN];
-#endif // defined(HOST_OS_LINUX) || defined(HOST_OS_MACOS) || \
- // defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOS) || \
+ // defined(DART_HOST_OS_ANDROID)
RawAddr addr_;
DISALLOW_COPY_AND_ASSIGN(SocketAddress);
diff --git a/runtime/bin/socket_base_android.cc b/runtime/bin/socket_base_android.cc
index 68163c6..f916aee 100644
--- a/runtime/bin/socket_base_android.cc
+++ b/runtime/bin/socket_base_android.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
#include "bin/socket_base.h"
@@ -470,4 +470,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_ANDROID)
diff --git a/runtime/bin/socket_base_fuchsia.cc b/runtime/bin/socket_base_fuchsia.cc
index be1eb256..5f36731 100644
--- a/runtime/bin/socket_base_fuchsia.cc
+++ b/runtime/bin/socket_base_fuchsia.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
#include "bin/socket_base.h"
@@ -429,4 +429,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_FUCHSIA)
+#endif // defined(DART_HOST_OS_FUCHSIA)
diff --git a/runtime/bin/socket_base_linux.cc b/runtime/bin/socket_base_linux.cc
index 89e579f..01d9d22 100644
--- a/runtime/bin/socket_base_linux.cc
+++ b/runtime/bin/socket_base_linux.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_LINUX)
+#if defined(DART_HOST_OS_LINUX)
#include "bin/socket_base.h"
@@ -472,4 +472,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_LINUX)
+#endif // defined(DART_HOST_OS_LINUX)
diff --git a/runtime/bin/socket_base_macos.cc b/runtime/bin/socket_base_macos.cc
index 0b259ee..cb26ed4 100644
--- a/runtime/bin/socket_base_macos.cc
+++ b/runtime/bin/socket_base_macos.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_MACOS)
#include "bin/socket_base.h"
@@ -484,4 +484,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_MACOS)
+#endif // defined(DART_HOST_OS_MACOS)
diff --git a/runtime/bin/socket_base_win.cc b/runtime/bin/socket_base_win.cc
index d762ad9..120d42f 100644
--- a/runtime/bin/socket_base_win.cc
+++ b/runtime/bin/socket_base_win.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#include "bin/socket_base.h"
@@ -489,4 +489,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
diff --git a/runtime/bin/socket_fuchsia.cc b/runtime/bin/socket_fuchsia.cc
index fa8a958..9408ced 100644
--- a/runtime/bin/socket_fuchsia.cc
+++ b/runtime/bin/socket_fuchsia.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
#include "bin/socket.h"
@@ -266,4 +266,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_FUCHSIA)
+#endif // defined(DART_HOST_OS_FUCHSIA)
diff --git a/runtime/bin/socket_linux.cc b/runtime/bin/socket_linux.cc
index 686852f..166979c 100644
--- a/runtime/bin/socket_linux.cc
+++ b/runtime/bin/socket_linux.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_LINUX)
+#if defined(DART_HOST_OS_LINUX)
#include "bin/socket.h"
@@ -277,4 +277,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_LINUX)
+#endif // defined(DART_HOST_OS_LINUX)
diff --git a/runtime/bin/socket_macos.cc b/runtime/bin/socket_macos.cc
index f9e00c2..0e2767b 100644
--- a/runtime/bin/socket_macos.cc
+++ b/runtime/bin/socket_macos.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_MACOS)
#include "bin/socket.h"
@@ -294,4 +294,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_MACOS)
+#endif // defined(DART_HOST_OS_MACOS)
diff --git a/runtime/bin/socket_win.cc b/runtime/bin/socket_win.cc
index 4e393dc..ac93b31 100644
--- a/runtime/bin/socket_win.cc
+++ b/runtime/bin/socket_win.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#include "bin/builtin.h"
#include "bin/eventhandler.h"
@@ -315,4 +315,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
diff --git a/runtime/bin/stdio_android.cc b/runtime/bin/stdio_android.cc
index f019f25..1afb34f 100644
--- a/runtime/bin/stdio_android.cc
+++ b/runtime/bin/stdio_android.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
#include "bin/stdio.h"
@@ -111,4 +111,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_ANDROID)
diff --git a/runtime/bin/stdio_fuchsia.cc b/runtime/bin/stdio_fuchsia.cc
index a626fee..2f91a9c 100644
--- a/runtime/bin/stdio_fuchsia.cc
+++ b/runtime/bin/stdio_fuchsia.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
#include "bin/stdio.h"
@@ -62,4 +62,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_FUCHSIA)
+#endif // defined(DART_HOST_OS_FUCHSIA)
diff --git a/runtime/bin/stdio_linux.cc b/runtime/bin/stdio_linux.cc
index 50e25f3..17db9bd 100644
--- a/runtime/bin/stdio_linux.cc
+++ b/runtime/bin/stdio_linux.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_LINUX)
+#if defined(DART_HOST_OS_LINUX)
#include "bin/stdio.h"
@@ -111,4 +111,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_LINUX)
+#endif // defined(DART_HOST_OS_LINUX)
diff --git a/runtime/bin/stdio_macos.cc b/runtime/bin/stdio_macos.cc
index 3b1aa5e..969b75d 100644
--- a/runtime/bin/stdio_macos.cc
+++ b/runtime/bin/stdio_macos.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_MACOS)
#include "bin/stdio.h"
@@ -111,4 +111,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_MACOS)
+#endif // defined(DART_HOST_OS_MACOS)
diff --git a/runtime/bin/stdio_win.cc b/runtime/bin/stdio_win.cc
index cbfc2d8..dc65cba 100644
--- a/runtime/bin/stdio_win.cc
+++ b/runtime/bin/stdio_win.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#include "bin/stdio.h"
@@ -136,4 +136,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
diff --git a/runtime/bin/sync_socket_android.cc b/runtime/bin/sync_socket_android.cc
index 80094f7..b38f809 100644
--- a/runtime/bin/sync_socket_android.cc
+++ b/runtime/bin/sync_socket_android.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
#include "bin/sync_socket.h"
@@ -89,4 +89,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_ANDROID)
diff --git a/runtime/bin/sync_socket_fuchsia.cc b/runtime/bin/sync_socket_fuchsia.cc
index 23461f4f..2775e5b 100644
--- a/runtime/bin/sync_socket_fuchsia.cc
+++ b/runtime/bin/sync_socket_fuchsia.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
#include "bin/sync_socket.h"
@@ -89,4 +89,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_FUCHSIA)
+#endif // defined(DART_HOST_OS_FUCHSIA)
diff --git a/runtime/bin/sync_socket_linux.cc b/runtime/bin/sync_socket_linux.cc
index 963787b..5c72f32 100644
--- a/runtime/bin/sync_socket_linux.cc
+++ b/runtime/bin/sync_socket_linux.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_LINUX)
+#if defined(DART_HOST_OS_LINUX)
#include "bin/sync_socket.h"
@@ -89,4 +89,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_LINUX)
+#endif // defined(DART_HOST_OS_LINUX)
diff --git a/runtime/bin/sync_socket_macos.cc b/runtime/bin/sync_socket_macos.cc
index e266341..83535b8 100644
--- a/runtime/bin/sync_socket_macos.cc
+++ b/runtime/bin/sync_socket_macos.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_MACOS)
#include "bin/sync_socket.h"
@@ -92,4 +92,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_MACOS)
+#endif // defined(DART_HOST_OS_MACOS)
diff --git a/runtime/bin/sync_socket_win.cc b/runtime/bin/sync_socket_win.cc
index d4e72fe..d690e29 100644
--- a/runtime/bin/sync_socket_win.cc
+++ b/runtime/bin/sync_socket_win.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#include "bin/socket_base.h"
#include "bin/sync_socket.h"
@@ -96,4 +96,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
diff --git a/runtime/bin/test_extension_dllmain_win.cc b/runtime/bin/test_extension_dllmain_win.cc
index 2cee311..161913b 100644
--- a/runtime/bin/test_extension_dllmain_win.cc
+++ b/runtime/bin/test_extension_dllmain_win.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#define WIN32_LEAN_AND_MEAN
#include <windows.h> // NOLINT
@@ -12,4 +12,4 @@
return true;
}
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
diff --git a/runtime/bin/thread.h b/runtime/bin/thread.h
index 09c9743..d6716c9 100644
--- a/runtime/bin/thread.h
+++ b/runtime/bin/thread.h
@@ -16,15 +16,15 @@
} // namespace dart
// Declare the OS-specific types ahead of defining the generic classes.
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
#include "bin/thread_android.h"
-#elif defined(HOST_OS_FUCHSIA)
+#elif defined(DART_HOST_OS_FUCHSIA)
#include "bin/thread_fuchsia.h"
-#elif defined(HOST_OS_LINUX)
+#elif defined(DART_HOST_OS_LINUX)
#include "bin/thread_linux.h"
-#elif defined(HOST_OS_MACOS)
+#elif defined(DART_HOST_OS_MACOS)
#include "bin/thread_macos.h"
-#elif defined(HOST_OS_WINDOWS)
+#elif defined(DART_HOST_OS_WINDOWS)
#include "bin/thread_win.h"
#else
#error Unknown target os.
diff --git a/runtime/bin/thread_android.cc b/runtime/bin/thread_android.cc
index 28b47ad..d386ceb 100644
--- a/runtime/bin/thread_android.cc
+++ b/runtime/bin/thread_android.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
#include "bin/thread.h"
#include "bin/thread_android.h"
@@ -298,4 +298,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_ANDROID)
diff --git a/runtime/bin/thread_fuchsia.cc b/runtime/bin/thread_fuchsia.cc
index d71a1df..66b847d 100644
--- a/runtime/bin/thread_fuchsia.cc
+++ b/runtime/bin/thread_fuchsia.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
#include "bin/thread.h"
#include "bin/thread_fuchsia.h"
@@ -305,4 +305,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_FUCHSIA)
+#endif // defined(DART_HOST_OS_FUCHSIA)
diff --git a/runtime/bin/thread_linux.cc b/runtime/bin/thread_linux.cc
index 2b3a7e6..b671d0c 100644
--- a/runtime/bin/thread_linux.cc
+++ b/runtime/bin/thread_linux.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_LINUX)
+#if defined(DART_HOST_OS_LINUX)
#include "bin/thread.h"
#include "bin/thread_linux.h"
@@ -301,4 +301,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_LINUX)
+#endif // defined(DART_HOST_OS_LINUX)
diff --git a/runtime/bin/thread_macos.cc b/runtime/bin/thread_macos.cc
index af636f0..a38c441 100644
--- a/runtime/bin/thread_macos.cc
+++ b/runtime/bin/thread_macos.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_MACOS)
#include "bin/thread.h"
#include "bin/thread_macos.h"
@@ -294,4 +294,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_MACOS)
+#endif // defined(DART_HOST_OS_MACOS)
diff --git a/runtime/bin/thread_win.cc b/runtime/bin/thread_win.cc
index ef6b632..53809f3 100644
--- a/runtime/bin/thread_win.cc
+++ b/runtime/bin/thread_win.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#include "bin/thread.h"
#include "bin/thread_win.h"
@@ -192,4 +192,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
diff --git a/runtime/bin/utils_android.cc b/runtime/bin/utils_android.cc
index ed6b5de..53a4cec 100644
--- a/runtime/bin/utils_android.cc
+++ b/runtime/bin/utils_android.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
#include <errno.h> // NOLINT
#include <netdb.h> // NOLINT
@@ -115,4 +115,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_ANDROID)
diff --git a/runtime/bin/utils_fuchsia.cc b/runtime/bin/utils_fuchsia.cc
index c7bbe08..f034e87 100644
--- a/runtime/bin/utils_fuchsia.cc
+++ b/runtime/bin/utils_fuchsia.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
#include <errno.h>
#include <zircon/syscalls.h>
@@ -89,4 +89,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_FUCHSIA)
+#endif // defined(DART_HOST_OS_FUCHSIA)
diff --git a/runtime/bin/utils_linux.cc b/runtime/bin/utils_linux.cc
index b87778a..9c9ad3a 100644
--- a/runtime/bin/utils_linux.cc
+++ b/runtime/bin/utils_linux.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_LINUX)
+#if defined(DART_HOST_OS_LINUX)
#include <errno.h> // NOLINT
#include <netdb.h> // NOLINT
@@ -114,4 +114,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_LINUX)
+#endif // defined(DART_HOST_OS_LINUX)
diff --git a/runtime/bin/utils_macos.cc b/runtime/bin/utils_macos.cc
index 52066bc..219d643 100644
--- a/runtime/bin/utils_macos.cc
+++ b/runtime/bin/utils_macos.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_MACOS)
#include <errno.h> // NOLINT
#include <mach/clock.h> // NOLINT
@@ -120,4 +120,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_MACOS)
+#endif // defined(DART_HOST_OS_MACOS)
diff --git a/runtime/bin/utils_win.cc b/runtime/bin/utils_win.cc
index f73bd20..fcbbcbb 100644
--- a/runtime/bin/utils_win.cc
+++ b/runtime/bin/utils_win.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#include <errno.h> // NOLINT
#include <time.h> // NOLINT
@@ -224,4 +224,4 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
diff --git a/runtime/bin/vmservice_impl.cc b/runtime/bin/vmservice_impl.cc
index 47b7992..4f82645 100644
--- a/runtime/bin/vmservice_impl.cc
+++ b/runtime/bin/vmservice_impl.cc
@@ -197,7 +197,7 @@
SHUTDOWN_ON_ERROR(result);
// Are we running on Windows?
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
Dart_Handle is_windows = Dart_True();
#else
Dart_Handle is_windows = Dart_False();
@@ -207,7 +207,7 @@
SHUTDOWN_ON_ERROR(result);
// Are we running on Fuchsia?
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
Dart_Handle is_fuchsia = Dart_True();
#else
Dart_Handle is_fuchsia = Dart_False();
diff --git a/runtime/lib/double.cc b/runtime/lib/double.cc
index 09136b7..bc7c33b 100644
--- a/runtime/lib/double.cc
+++ b/runtime/lib/double.cc
@@ -4,7 +4,7 @@
#include "vm/bootstrap_natives.h"
-#include <math.h>
+#include <math.h> // NOLINT
#include "vm/dart_entry.h"
#include "vm/double_conversion.h"
@@ -180,7 +180,7 @@
return Double::New(trunc(arg.value()));
}
-#if defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_MACOS)
// MAC OSX math library produces old style cast warning.
#pragma GCC diagnostic ignored "-Wold-style-cast"
#endif
diff --git a/runtime/lib/ffi_dynamic_library.cc b/runtime/lib/ffi_dynamic_library.cc
index eb8e74b..b2f8c37 100644
--- a/runtime/lib/ffi_dynamic_library.cc
+++ b/runtime/lib/ffi_dynamic_library.cc
@@ -8,8 +8,8 @@
#include "vm/globals.h"
#include "vm/native_entry.h"
-#if !defined(HOST_OS_LINUX) && !defined(HOST_OS_MACOS) && \
- !defined(HOST_OS_ANDROID) && !defined(HOST_OS_FUCHSIA)
+#if !defined(DART_HOST_OS_LINUX) && !defined(DART_HOST_OS_MACOS) && \
+ !defined(DART_HOST_OS_ANDROID) && !defined(DART_HOST_OS_FUCHSIA)
// TODO(dacoharkes): Implement dynamic libraries for other targets & merge the
// implementation with:
// - runtime/bin/extensions.h
@@ -23,8 +23,8 @@
namespace dart {
static void* LoadExtensionLibrary(const char* library_file) {
-#if defined(HOST_OS_LINUX) || defined(HOST_OS_MACOS) || \
- defined(HOST_OS_ANDROID) || defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOS) || \
+ defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_FUCHSIA)
void* handle = dlopen(library_file, RTLD_LAZY);
if (handle == nullptr) {
char* error = dlerror();
@@ -34,7 +34,7 @@
}
return handle;
-#elif defined(HOST_OS_WINDOWS)
+#elif defined(DART_HOST_OS_WINDOWS)
SetLastError(0); // Clear any errors.
void* ext;
@@ -78,8 +78,8 @@
}
DEFINE_NATIVE_ENTRY(Ffi_dl_processLibrary, 0, 0) {
-#if defined(HOST_OS_LINUX) || defined(HOST_OS_MACOS) || \
- defined(HOST_OS_ANDROID) || defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOS) || \
+ defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_FUCHSIA)
return DynamicLibrary::New(RTLD_DEFAULT);
#else
const Array& args = Array::Handle(Array::New(1));
@@ -95,8 +95,8 @@
}
static void* ResolveSymbol(void* handle, const char* symbol) {
-#if defined(HOST_OS_LINUX) || defined(HOST_OS_MACOS) || \
- defined(HOST_OS_ANDROID) || defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOS) || \
+ defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_FUCHSIA)
dlerror(); // Clear any errors.
void* pointer = dlsym(handle, symbol);
char* error = dlerror();
@@ -106,7 +106,7 @@
Exceptions::ThrowArgumentError(msg);
}
return pointer;
-#elif defined(HOST_OS_WINDOWS)
+#elif defined(DART_HOST_OS_WINDOWS)
SetLastError(0);
void* pointer = reinterpret_cast<void*>(
GetProcAddress(reinterpret_cast<HMODULE>(handle), symbol));
@@ -148,14 +148,14 @@
}
static bool SymbolExists(void* handle, const char* symbol) {
-#if defined(HOST_OS_LINUX) || defined(HOST_OS_MACOS) || \
- defined(HOST_OS_ANDROID) || defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOS) || \
+ defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_FUCHSIA)
dlerror(); // Clear previous error, if any.
dlsym(handle, symbol);
// Checking whether dlsym returns a nullptr is not enough, as the value of
// the symbol could actually be NULL. Check the error condition instead.
return dlerror() == nullptr;
-#elif defined(HOST_OS_WINDOWS)
+#elif defined(DART_HOST_OS_WINDOWS)
return GetProcAddress(reinterpret_cast<HMODULE>(handle), symbol) != nullptr;
#else
const Array& args = Array::Handle(Array::New(1));
diff --git a/runtime/lib/uri.cc b/runtime/lib/uri.cc
index af4c65d..06df6d7 100644
--- a/runtime/lib/uri.cc
+++ b/runtime/lib/uri.cc
@@ -9,7 +9,7 @@
namespace dart {
DEFINE_NATIVE_ENTRY(Uri_isWindowsPlatform, 0, 0) {
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
return Bool::True().ptr();
#else
return Bool::False().ptr();
diff --git a/runtime/platform/assert.cc b/runtime/platform/assert.cc
index 85e4ea2..5c7bf0b 100644
--- a/runtime/platform/assert.cc
+++ b/runtime/platform/assert.cc
@@ -8,9 +8,9 @@
#include "platform/globals.h"
#include "platform/syslog.h"
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
extern "C" __attribute__((weak)) void android_set_abort_message(const char*);
-#endif // defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_ANDROID)
namespace dart {
@@ -36,11 +36,11 @@
// Print the buffer on stderr and/or syslog.
Syslog::PrintErr("%s\n", buffer);
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
if (will_abort && (&android_set_abort_message != nullptr)) {
android_set_abort_message(buffer);
}
-#endif // defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_ANDROID)
}
void Assert::Fail(const char* format, ...) {
diff --git a/runtime/platform/floating_point_win.cc b/runtime/platform/floating_point_win.cc
index 7fffe7a..6e853d6 100644
--- a/runtime/platform/floating_point_win.cc
+++ b/runtime/platform/floating_point_win.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#include "platform/floating_point_win.h"
@@ -46,4 +46,4 @@
}
}
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
diff --git a/runtime/platform/globals.h b/runtime/platform/globals.h
index cc8eec1..42edc70 100644
--- a/runtime/platform/globals.h
+++ b/runtime/platform/globals.h
@@ -106,33 +106,31 @@
#if defined(__ANDROID__)
// Check for Android first, to determine its difference from Linux.
-#define HOST_OS_ANDROID 1
+#define DART_HOST_OS_ANDROID 1
#elif defined(__linux__) || defined(__FreeBSD__)
// Generic Linux.
-#define HOST_OS_LINUX 1
+#define DART_HOST_OS_LINUX 1
#elif defined(__APPLE__)
// Define the flavor of Mac OS we are running on.
#include <TargetConditionals.h>
-// TODO(iposva): Rename HOST_OS_MACOS to HOST_OS_MAC to inherit
-// the value defined in TargetConditionals.h
-#define HOST_OS_MACOS 1
+#define DART_HOST_OS_MACOS 1
#if TARGET_OS_IPHONE
-#define HOST_OS_IOS 1
+#define DART_HOST_OS_IOS 1
#endif
#elif defined(_WIN32)
// Windows, both 32- and 64-bit, regardless of the check for _WIN32.
-#define HOST_OS_WINDOWS 1
+#define DART_HOST_OS_WINDOWS 1
#elif defined(__Fuchsia__)
-#define HOST_OS_FUCHSIA
+#define DART_HOST_OS_FUCHSIA
-#elif !defined(HOST_OS_FUCHSIA)
+#elif !defined(DART_HOST_OS_FUCHSIA)
#error Automatic target os detection failed.
#endif
@@ -374,23 +372,23 @@
#error Unknown architecture.
#endif
-#if !defined(TARGET_OS_ANDROID) && !defined(TARGET_OS_FUCHSIA) && \
- !defined(TARGET_OS_MACOS_IOS) && !defined(TARGET_OS_LINUX) && \
- !defined(TARGET_OS_MACOS) && !defined(TARGET_OS_WINDOWS)
+#if !defined(DART_TARGET_OS_ANDROID) && !defined(DART_TARGET_OS_FUCHSIA) && \
+ !defined(DART_TARGET_OS_MACOS_IOS) && !defined(DART_TARGET_OS_LINUX) && \
+ !defined(DART_TARGET_OS_MACOS) && !defined(DART_TARGET_OS_WINDOWS)
// No target OS specified; pick the one matching the host OS.
-#if defined(HOST_OS_ANDROID)
-#define TARGET_OS_ANDROID 1
-#elif defined(HOST_OS_FUCHSIA)
-#define TARGET_OS_FUCHSIA 1
-#elif defined(HOST_OS_IOS)
-#define TARGET_OS_MACOS 1
-#define TARGET_OS_MACOS_IOS 1
-#elif defined(HOST_OS_LINUX)
-#define TARGET_OS_LINUX 1
-#elif defined(HOST_OS_MACOS)
-#define TARGET_OS_MACOS 1
-#elif defined(HOST_OS_WINDOWS)
-#define TARGET_OS_WINDOWS 1
+#if defined(DART_HOST_OS_ANDROID)
+#define DART_TARGET_OS_ANDROID 1
+#elif defined(DART_HOST_OS_FUCHSIA)
+#define DART_TARGET_OS_FUCHSIA 1
+#elif defined(DART_HOST_OS_IOS)
+#define DART_TARGET_OS_MACOS 1
+#define DART_TARGET_OS_MACOS_IOS 1
+#elif defined(DART_HOST_OS_LINUX)
+#define DART_TARGET_OS_LINUX 1
+#elif defined(DART_HOST_OS_MACOS)
+#define DART_TARGET_OS_MACOS 1
+#elif defined(DART_HOST_OS_WINDOWS)
+#define DART_TARGET_OS_WINDOWS 1
#else
#error Automatic target OS detection failed.
#endif
@@ -399,8 +397,8 @@
// Determine whether dual mapping of code pages is supported.
// We test dual mapping on linux x64 and deploy it on fuchsia.
#if !defined(DART_PRECOMPILED_RUNTIME) && \
- (defined(TARGET_OS_LINUX) && defined(TARGET_ARCH_X64) || \
- defined(TARGET_OS_FUCHSIA))
+ (defined(DART_TARGET_OS_LINUX) && defined(TARGET_ARCH_X64) || \
+ defined(DART_TARGET_OS_FUCHSIA))
#define DUAL_MAPPING_SUPPORTED 1
#endif
@@ -670,19 +668,19 @@
// On Windows the reentrent version of strtok is called
// strtok_s. Unify on the posix name strtok_r.
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#define snprintf _sprintf_p
#define strtok_r strtok_s
#endif
-#if !defined(HOST_OS_WINDOWS)
+#if !defined(DART_HOST_OS_WINDOWS)
#if defined(TEMP_FAILURE_RETRY)
// TEMP_FAILURE_RETRY is defined in unistd.h on some platforms. We should
// not use that version, but instead the one in signal_blocker.h, to ensure
// we disable signal interrupts.
#undef TEMP_FAILURE_RETRY
#endif // defined(TEMP_FAILURE_RETRY)
-#endif // !defined(HOST_OS_WINDOWS)
+#endif // !defined(DART_HOST_OS_WINDOWS)
#if __GNUC__
// Tell the compiler to do printf format string checking if the
diff --git a/runtime/platform/signal_blocker.h b/runtime/platform/signal_blocker.h
index c56c1da..e47ac60 100644
--- a/runtime/platform/signal_blocker.h
+++ b/runtime/platform/signal_blocker.h
@@ -8,7 +8,7 @@
#include "platform/assert.h"
#include "platform/globals.h"
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#error Do not include this file on Windows.
#endif
diff --git a/runtime/platform/syslog_android.cc b/runtime/platform/syslog_android.cc
index 9aa77c0..46930e9 100644
--- a/runtime/platform/syslog_android.cc
+++ b/runtime/platform/syslog_android.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
#include "platform/syslog.h"
@@ -35,4 +35,4 @@
} // namespace dart
-#endif // defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_ANDROID)
diff --git a/runtime/platform/syslog_fuchsia.cc b/runtime/platform/syslog_fuchsia.cc
index 85e4c80..f9b0d65 100644
--- a/runtime/platform/syslog_fuchsia.cc
+++ b/runtime/platform/syslog_fuchsia.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
#include "platform/syslog.h"
@@ -23,4 +23,4 @@
} // namespace dart
-#endif // defined(HOST_OS_FUCHSIA)
+#endif // defined(DART_HOST_OS_FUCHSIA)
diff --git a/runtime/platform/syslog_linux.cc b/runtime/platform/syslog_linux.cc
index 269bc9f2..ea73f2b 100644
--- a/runtime/platform/syslog_linux.cc
+++ b/runtime/platform/syslog_linux.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_LINUX)
+#if defined(DART_HOST_OS_LINUX)
#include "platform/syslog.h"
@@ -23,4 +23,4 @@
} // namespace dart
-#endif // defined(HOST_OS_LINUX)
+#endif // defined(DART_HOST_OS_LINUX)
diff --git a/runtime/platform/syslog_macos.cc b/runtime/platform/syslog_macos.cc
index f01bfbf..bfb3a7e 100644
--- a/runtime/platform/syslog_macos.cc
+++ b/runtime/platform/syslog_macos.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_MACOS)
#include "platform/syslog.h"
@@ -23,4 +23,4 @@
} // namespace dart
-#endif // defined(HOST_OS_MACOS)
+#endif // defined(DART_HOST_OS_MACOS)
diff --git a/runtime/platform/syslog_win.cc b/runtime/platform/syslog_win.cc
index 07ab815..20833b7 100644
--- a/runtime/platform/syslog_win.cc
+++ b/runtime/platform/syslog_win.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#include "platform/syslog.h"
@@ -23,4 +23,4 @@
} // namespace dart
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
diff --git a/runtime/platform/utils.cc b/runtime/platform/utils.cc
index 1ba74f7..d04c3a8 100644
--- a/runtime/platform/utils.cc
+++ b/runtime/platform/utils.cc
@@ -57,7 +57,7 @@
return CountLeadingZeros32(x_hi);
}
return 32 + CountLeadingZeros32(static_cast<uint32_t>(x));
-#elif defined(HOST_OS_WINDOWS)
+#elif defined(DART_HOST_OS_WINDOWS)
unsigned long position; // NOLINT
return (_BitScanReverse64(&position, x) == 0)
? 64
@@ -68,7 +68,7 @@
}
int Utils::CountLeadingZeros32(uint32_t x) {
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
unsigned long position; // NOLINT
return (_BitScanReverse(&position, x) == 0) ? 32
: 31 - static_cast<int>(position);
@@ -84,7 +84,7 @@
return CountTrailingZeros32(x_lo);
}
return 32 + CountTrailingZeros32(static_cast<uint32_t>(x >> 32));
-#elif defined(HOST_OS_WINDOWS)
+#elif defined(DART_HOST_OS_WINDOWS)
unsigned long position; // NOLINT
return (_BitScanForward64(&position, x) == 0) ? 64
: static_cast<int>(position);
@@ -94,7 +94,7 @@
}
int Utils::CountTrailingZeros32(uint32_t x) {
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
unsigned long position; // NOLINT
return (_BitScanForward(&position, x) == 0) ? 32 : static_cast<int>(position);
#else
diff --git a/runtime/platform/utils.h b/runtime/platform/utils.h
index 41054c4..98f1a1c 100644
--- a/runtime/platform/utils.h
+++ b/runtime/platform/utils.h
@@ -481,15 +481,15 @@
} // namespace dart
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
#include "platform/utils_android.h"
-#elif defined(HOST_OS_FUCHSIA)
+#elif defined(DART_HOST_OS_FUCHSIA)
#include "platform/utils_fuchsia.h"
-#elif defined(HOST_OS_LINUX)
+#elif defined(DART_HOST_OS_LINUX)
#include "platform/utils_linux.h"
-#elif defined(HOST_OS_MACOS)
+#elif defined(DART_HOST_OS_MACOS)
#include "platform/utils_macos.h"
-#elif defined(HOST_OS_WINDOWS)
+#elif defined(DART_HOST_OS_WINDOWS)
#include "platform/utils_win.h"
#else
#error Unknown target os.
diff --git a/runtime/platform/utils_android.cc b/runtime/platform/utils_android.cc
index 72618eb..6e14851 100644
--- a/runtime/platform/utils_android.cc
+++ b/runtime/platform/utils_android.cc
@@ -3,9 +3,10 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
#include "platform/utils.h"
+#include "platform/utils_android.h"
namespace dart {
@@ -49,4 +50,4 @@
} // namespace dart
-#endif // defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_ANDROID)
diff --git a/runtime/platform/utils_fuchsia.cc b/runtime/platform/utils_fuchsia.cc
index a6d9f37..8f6c7ac 100644
--- a/runtime/platform/utils_fuchsia.cc
+++ b/runtime/platform/utils_fuchsia.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
#include <memory>
#include <utility>
@@ -78,4 +78,4 @@
} // namespace dart
-#endif // defined(HOST_OS_FUCHSIA)
+#endif // defined(DART_HOST_OS_FUCHSIA)
diff --git a/runtime/platform/utils_linux.cc b/runtime/platform/utils_linux.cc
index c430bca..ec4aead 100644
--- a/runtime/platform/utils_linux.cc
+++ b/runtime/platform/utils_linux.cc
@@ -3,9 +3,10 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_LINUX)
+#if defined(DART_HOST_OS_LINUX)
#include "platform/utils.h"
+#include "platform/utils_linux.h"
namespace dart {
@@ -50,4 +51,4 @@
} // namespace dart
-#endif // defined(HOST_OS_LINUX)
+#endif // defined(DART_HOST_OS_LINUX)
diff --git a/runtime/platform/utils_macos.cc b/runtime/platform/utils_macos.cc
index a801746..9de2e43 100644
--- a/runtime/platform/utils_macos.cc
+++ b/runtime/platform/utils_macos.cc
@@ -3,9 +3,10 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_MACOS)
#include "platform/utils.h"
+#include "platform/utils_macos.h"
#include <errno.h> // NOLINT
#include <sys/utsname.h> // NOLINT
@@ -150,4 +151,4 @@
} // namespace dart
-#endif // defined(HOST_OS_MACOS)
+#endif // defined(DART_HOST_OS_MACOS)
diff --git a/runtime/platform/utils_win.cc b/runtime/platform/utils_win.cc
index 7ba2ec8..25d2f1d 100644
--- a/runtime/platform/utils_win.cc
+++ b/runtime/platform/utils_win.cc
@@ -3,11 +3,13 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#include <io.h> // NOLINT
+
#include "platform/allocation.h"
#include "platform/utils.h"
+#include "platform/utils_win.h"
namespace dart {
@@ -86,4 +88,4 @@
} // namespace dart
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
diff --git a/runtime/tools/run_clang_tidy.dart b/runtime/tools/run_clang_tidy.dart
index 6e35eba..aa32b3b 100644
--- a/runtime/tools/run_clang_tidy.dart
+++ b/runtime/tools/run_clang_tidy.dart
@@ -20,7 +20,7 @@
'-Ithird_party/zlib',
'-DTARGET_ARCH_X64',
'-DDEBUG',
- '-DTARGET_OS_LINUX',
+ '-DDART_TARGET_OS_LINUX',
'-DTESTING',
'-std=c++17',
'-x',
diff --git a/runtime/vm/compiler/assembler/assembler_arm.cc b/runtime/vm/compiler/assembler/assembler_arm.cc
index 63cba26..7cf8272 100644
--- a/runtime/vm/compiler/assembler/assembler_arm.cc
+++ b/runtime/vm/compiler/assembler/assembler_arm.cc
@@ -15,7 +15,7 @@
// An extra check since we are assuming the existence of /proc/cpuinfo below.
#if !defined(USING_SIMULATOR) && !defined(__linux__) && !defined(ANDROID) && \
- !defined(HOST_OS_IOS) && !defined(HOST_OS_MACOS)
+ !defined(DART_HOST_OS_IOS) && !defined(DART_HOST_OS_MACOS)
#error ARM cross-compile only supported on Linux, Android, iOS, and Mac
#endif
diff --git a/runtime/vm/compiler/assembler/assembler_x64_test.cc b/runtime/vm/compiler/assembler/assembler_x64_test.cc
index 9704c22..00eeead 100644
--- a/runtime/vm/compiler/assembler/assembler_x64_test.cc
+++ b/runtime/vm/compiler/assembler/assembler_x64_test.cc
@@ -32,7 +32,7 @@
intptr_t exp_len = strlen(expected); \
EXPECT_GT(dis_len, exp_len); \
EXPECT_STREQ(expected, disassembly + dis_len - exp_len);
-#if defined(TARGET_OS_WINDOWS)
+#if defined(DART_TARGET_OS_WINDOWS)
// Windows has different calling conventions on x64, which means the
// disassembly looks different on some tests. We skip testing the
// disassembly output for those tests on Windows.
@@ -5435,7 +5435,7 @@
ASSEMBLER_TEST_GENERATE(DoubleAbs, assembler) {
EnterTestFrame(assembler);
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
// First argument is code object, second argument is thread. MSVC passes
// third argument in XMM2.
__ DoubleAbs(XMM0, XMM2);
diff --git a/runtime/vm/compiler/backend/il_arm.cc b/runtime/vm/compiler/backend/il_arm.cc
index 0ac5dfd..80aaa47 100644
--- a/runtime/vm/compiler/backend/il_arm.cc
+++ b/runtime/vm/compiler/backend/il_arm.cc
@@ -1544,7 +1544,7 @@
__ PopNativeCalleeSavedRegisters();
-#if defined(TARGET_OS_FUCHSIA) && defined(USING_SHADOW_CALL_STACK)
+#if defined(DART_TARGET_OS_FUCHSIA) && defined(USING_SHADOW_CALL_STACK)
#error Unimplemented
#endif
@@ -1580,7 +1580,7 @@
// Save a space for the code object.
__ PushImmediate(0);
-#if defined(TARGET_OS_FUCHSIA) && defined(USING_SHADOW_CALL_STACK)
+#if defined(DART_TARGET_OS_FUCHSIA) && defined(USING_SHADOW_CALL_STACK)
#error Unimplemented
#endif
diff --git a/runtime/vm/compiler/backend/il_arm64.cc b/runtime/vm/compiler/backend/il_arm64.cc
index 87cc6b7c..223b424 100644
--- a/runtime/vm/compiler/backend/il_arm64.cc
+++ b/runtime/vm/compiler/backend/il_arm64.cc
@@ -1454,7 +1454,7 @@
// Now that we have THR, we can set CSP.
__ SetupCSPFromThread(THR);
-#if defined(TARGET_OS_FUCHSIA)
+#if defined(DART_TARGET_OS_FUCHSIA)
__ str(R18,
compiler::Address(
THR, compiler::target::Thread::saved_shadow_call_stack_offset()));
diff --git a/runtime/vm/compiler/backend/il_ia32.cc b/runtime/vm/compiler/backend/il_ia32.cc
index f7ef9ae..ee1ab8c 100644
--- a/runtime/vm/compiler/backend/il_ia32.cc
+++ b/runtime/vm/compiler/backend/il_ia32.cc
@@ -331,7 +331,7 @@
__ popl(ESI);
__ popl(EBX);
-#if defined(TARGET_OS_FUCHSIA) && defined(USING_SHADOW_CALL_STACK)
+#if defined(DART_TARGET_OS_FUCHSIA) && defined(USING_SHADOW_CALL_STACK)
#error Unimplemented
#endif
@@ -1131,7 +1131,7 @@
__ xorl(EAX, EAX);
__ pushl(EAX);
-#if defined(TARGET_OS_FUCHSIA) && defined(USING_SHADOW_CALL_STACK)
+#if defined(DART_TARGET_OS_FUCHSIA) && defined(USING_SHADOW_CALL_STACK)
#error Unimplemented
#endif
diff --git a/runtime/vm/compiler/backend/il_x64.cc b/runtime/vm/compiler/backend/il_x64.cc
index 7882a76..cb4c1be 100644
--- a/runtime/vm/compiler/backend/il_x64.cc
+++ b/runtime/vm/compiler/backend/il_x64.cc
@@ -409,7 +409,7 @@
// Restore C++ ABI callee-saved registers.
__ PopRegisters(kCalleeSaveRegistersSet);
-#if defined(TARGET_OS_FUCHSIA) && defined(USING_SHADOW_CALL_STACK)
+#if defined(DART_TARGET_OS_FUCHSIA) && defined(USING_SHADOW_CALL_STACK)
#error Unimplemented
#endif
@@ -1310,7 +1310,7 @@
// NativeReturnInstr::EmitNativeCode.
__ EnterFrame(0);
-#if defined(TARGET_OS_FUCHSIA) && defined(USING_SHADOW_CALL_STACK)
+#if defined(DART_TARGET_OS_FUCHSIA) && defined(USING_SHADOW_CALL_STACK)
#error Unimplemented
#endif
diff --git a/runtime/vm/compiler/ffi/abi.cc b/runtime/vm/compiler/ffi/abi.cc
index 1d3bd8b..d71ad34 100644
--- a/runtime/vm/compiler/ffi/abi.cc
+++ b/runtime/vm/compiler/ffi/abi.cc
@@ -28,14 +28,14 @@
static_assert(offsetof(AbiAlignmentUint64, i) == 8,
"FFI transformation alignment");
#elif (defined(HOST_ARCH_IA32) && /* NOLINT(whitespace/parens) */ \
- (defined(HOST_OS_LINUX) || defined(HOST_OS_MACOS) || \
- defined(HOST_OS_ANDROID))) || \
- (defined(HOST_ARCH_ARM) && defined(HOST_OS_IOS))
+ (defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOS) || \
+ defined(DART_HOST_OS_ANDROID))) || \
+ (defined(HOST_ARCH_ARM) && defined(DART_HOST_OS_IOS))
static_assert(offsetof(AbiAlignmentDouble, d) == 4,
"FFI transformation alignment");
static_assert(offsetof(AbiAlignmentUint64, i) == 4,
"FFI transformation alignment");
-#elif defined(HOST_ARCH_IA32) && defined(HOST_OS_WINDOWS) || \
+#elif defined(HOST_ARCH_IA32) && defined(DART_HOST_OS_WINDOWS) || \
defined(HOST_ARCH_ARM)
static_assert(offsetof(AbiAlignmentDouble, d) == 8,
"FFI transformation alignment");
@@ -49,11 +49,11 @@
#if defined(TARGET_ARCH_X64) || defined(TARGET_ARCH_ARM64)
return Abi::kWordSize64;
#elif (defined(TARGET_ARCH_IA32) && /* NOLINT(whitespace/parens) */ \
- (defined(TARGET_OS_LINUX) || defined(TARGET_OS_MACOS) || \
- defined(TARGET_OS_ANDROID))) || \
- (defined(TARGET_ARCH_ARM) && defined(TARGET_OS_MACOS_IOS))
+ (defined(DART_TARGET_OS_LINUX) || defined(DART_TARGET_OS_MACOS) || \
+ defined(DART_TARGET_OS_ANDROID))) || \
+ (defined(TARGET_ARCH_ARM) && defined(DART_TARGET_OS_MACOS_IOS))
return Abi::kWordSize32Align32;
-#elif defined(TARGET_ARCH_IA32) && defined(TARGET_OS_WINDOWS) || \
+#elif defined(TARGET_ARCH_IA32) && defined(DART_TARGET_OS_WINDOWS) || \
defined(TARGET_ARCH_ARM)
return Abi::kWordSize32Align64;
#else
diff --git a/runtime/vm/compiler/ffi/native_calling_convention.cc b/runtime/vm/compiler/ffi/native_calling_convention.cc
index 8ed3646..0d81047 100644
--- a/runtime/vm/compiler/ffi/native_calling_convention.cc
+++ b/runtime/vm/compiler/ffi/native_calling_convention.cc
@@ -31,7 +31,7 @@
}
#else // !defined(FFI_UNIT_TESTS)
static bool SoftFpAbi() {
-#if defined(TARGET_ARCH_ARM) && defined(TARGET_OS_ANDROID)
+#if defined(TARGET_ARCH_ARM) && defined(DART_TARGET_OS_ANDROID)
return true;
#else
return false;
@@ -135,7 +135,7 @@
return AllocateStack(payload_type);
}
-#if defined(TARGET_ARCH_X64) && !defined(TARGET_OS_WINDOWS)
+#if defined(TARGET_ARCH_X64) && !defined(DART_TARGET_OS_WINDOWS)
// If fits in two fpu and/or cpu registers, transfer in those. Otherwise,
// transfer on stack.
const NativeLocation& AllocateCompound(
@@ -177,9 +177,9 @@
}
return AllocateStack(payload_type);
}
-#endif // defined(TARGET_ARCH_X64) && !defined(TARGET_OS_WINDOWS)
+#endif // defined(TARGET_ARCH_X64) && !defined(DART_TARGET_OS_WINDOWS)
-#if defined(TARGET_ARCH_X64) && defined(TARGET_OS_WINDOWS)
+#if defined(TARGET_ARCH_X64) && defined(DART_TARGET_OS_WINDOWS)
// If struct fits in a single register and size is a power of two, then
// use a single register and sign extend.
// Otherwise, pass a pointer to a copy.
@@ -209,7 +209,7 @@
return AllocateStack(payload_type);
}
-#endif // defined(TARGET_ARCH_X64) && defined(TARGET_OS_WINDOWS)
+#endif // defined(TARGET_ARCH_X64) && defined(DART_TARGET_OS_WINDOWS)
#if defined(TARGET_ARCH_IA32)
const NativeLocation& AllocateCompound(
@@ -512,7 +512,7 @@
}
#endif // defined(TARGET_ARCH_IA32)
-#if defined(TARGET_ARCH_X64) && !defined(TARGET_OS_WINDOWS)
+#if defined(TARGET_ARCH_X64) && !defined(DART_TARGET_OS_WINDOWS)
static const NativeLocation& CompoundResultLocation(
Zone* zone,
const NativeCompoundType& payload_type) {
@@ -564,9 +564,9 @@
}
return PointerToMemoryResultLocation(zone, payload_type);
}
-#endif // defined(TARGET_ARCH_X64) && !defined(TARGET_OS_WINDOWS)
+#endif // defined(TARGET_ARCH_X64) && !defined(DART_TARGET_OS_WINDOWS)
-#if defined(TARGET_ARCH_X64) && defined(TARGET_OS_WINDOWS)
+#if defined(TARGET_ARCH_X64) && defined(DART_TARGET_OS_WINDOWS)
// If struct fits in a single register do that, and sign extend.
// Otherwise, pass a pointer to memory.
static const NativeLocation& CompoundResultLocation(
@@ -584,17 +584,17 @@
}
return PointerToMemoryResultLocation(zone, payload_type);
}
-#endif // defined(TARGET_ARCH_X64) && defined(TARGET_OS_WINDOWS)
+#endif // defined(TARGET_ARCH_X64) && defined(DART_TARGET_OS_WINDOWS)
-#if defined(TARGET_ARCH_IA32) && !defined(TARGET_OS_WINDOWS)
+#if defined(TARGET_ARCH_IA32) && !defined(DART_TARGET_OS_WINDOWS)
static const NativeLocation& CompoundResultLocation(
Zone* zone,
const NativeCompoundType& payload_type) {
return PointerToMemoryResultLocation(zone, payload_type);
}
-#endif // defined(TARGET_ARCH_IA32) && !defined(TARGET_OS_WINDOWS)
+#endif // defined(TARGET_ARCH_IA32) && !defined(DART_TARGET_OS_WINDOWS)
-#if defined(TARGET_ARCH_IA32) && defined(TARGET_OS_WINDOWS)
+#if defined(TARGET_ARCH_IA32) && defined(DART_TARGET_OS_WINDOWS)
// Windows uses up to two return registers, while Linux does not.
static const NativeLocation& CompoundResultLocation(
Zone* zone,
@@ -615,7 +615,7 @@
}
return PointerToMemoryResultLocation(zone, payload_type);
}
-#endif // defined(TARGET_ARCH_IA32) && defined(TARGET_OS_WINDOWS)
+#endif // defined(TARGET_ARCH_IA32) && defined(DART_TARGET_OS_WINDOWS)
#if defined(TARGET_ARCH_ARM)
// Arm passes homogenous float return values in FPU registers and small
diff --git a/runtime/vm/compiler/ffi/native_calling_convention_test.cc b/runtime/vm/compiler/ffi/native_calling_convention_test.cc
index 1d1ae28..328c0ca 100644
--- a/runtime/vm/compiler/ffi/native_calling_convention_test.cc
+++ b/runtime/vm/compiler/ffi/native_calling_convention_test.cc
@@ -586,7 +586,7 @@
RunSignatureTest(Z, "regress46127", arguments, struct_type);
#if defined(TARGET_ARCH_IA32) && \
- (defined(TARGET_OS_ANDROID) || defined(TARGET_OS_LINUX))
+ (defined(DART_TARGET_OS_ANDROID) || defined(DART_TARGET_OS_LINUX))
// We must count the result pointer passed on the stack as well.
EXPECT_EQ(4, native_calling_convention.StackTopInBytes());
#else
@@ -610,7 +610,7 @@
const auto& struct_type = NativeStructType::FromNativeTypes(Z, member_types);
#if defined(TARGET_ARCH_ARM64) && \
- (defined(TARGET_OS_MACOS) || defined(TARGET_OS_MACOS_IOS))
+ (defined(DART_TARGET_OS_MACOS) || defined(DART_TARGET_OS_MACOS_IOS))
EXPECT_EQ(4, struct_type.AlignmentInBytesStack());
#endif
diff --git a/runtime/vm/compiler/ffi/native_type.cc b/runtime/vm/compiler/ffi/native_type.cc
index 686816c..b1f8d8c 100644
--- a/runtime/vm/compiler/ffi/native_type.cc
+++ b/runtime/vm/compiler/ffi/native_type.cc
@@ -174,7 +174,7 @@
// If this struct is passed on the stack, it should be aligned to the largest
// alignment of its members when passing those members on the stack.
intptr_t alignment_stack = kAtLeast1ByteAligned;
-#if (defined(TARGET_OS_MACOS_IOS) || defined(TARGET_OS_MACOS)) && \
+#if (defined(DART_TARGET_OS_MACOS_IOS) || defined(DART_TARGET_OS_MACOS)) && \
defined(TARGET_ARCH_ARM64)
// On iOS64 and MacOS arm64 stack values can be less aligned than wordSize,
// which deviates from the arm64 ABI.
diff --git a/runtime/vm/compiler/ffi/unit_test.cc b/runtime/vm/compiler/ffi/unit_test.cc
index 044b398..b58e59f 100644
--- a/runtime/vm/compiler/ffi/unit_test.cc
+++ b/runtime/vm/compiler/ffi/unit_test.cc
@@ -20,15 +20,15 @@
const char* kArch = "x64";
#endif
-#if defined(TARGET_OS_ANDROID)
+#if defined(DART_TARGET_OS_ANDROID)
const char* kOs = "android";
-#elif defined(TARGET_OS_MACOS_IOS)
+#elif defined(DART_TARGET_OS_MACOS_IOS)
const char* kOs = "ios";
-#elif defined(TARGET_OS_LINUX)
+#elif defined(DART_TARGET_OS_LINUX)
const char* kOs = "linux";
-#elif defined(TARGET_OS_MACOS)
+#elif defined(DART_TARGET_OS_MACOS)
const char* kOs = "macos";
-#elif defined(TARGET_OS_WINDOWS)
+#elif defined(DART_TARGET_OS_WINDOWS)
const char* kOs = "win";
#endif
diff --git a/runtime/vm/compiler/stub_code_compiler_arm.cc b/runtime/vm/compiler/stub_code_compiler_arm.cc
index ce2faf5..8b831c3 100644
--- a/runtime/vm/compiler/stub_code_compiler_arm.cc
+++ b/runtime/vm/compiler/stub_code_compiler_arm.cc
@@ -1226,7 +1226,7 @@
// target::frame_layout.exit_link_slot_from_entry_fp must be kept in sync
// with the code below.
-#if defined(TARGET_OS_MACOS) || defined(TARGET_OS_MACOS_IOS)
+#if defined(DART_TARGET_OS_MACOS) || defined(DART_TARGET_OS_MACOS_IOS)
ASSERT(target::frame_layout.exit_link_slot_from_entry_fp == -27);
#else
ASSERT(target::frame_layout.exit_link_slot_from_entry_fp == -28);
diff --git a/runtime/vm/compiler/stub_code_compiler_arm64.cc b/runtime/vm/compiler/stub_code_compiler_arm64.cc
index 451a41f..4d92ced 100644
--- a/runtime/vm/compiler/stub_code_compiler_arm64.cc
+++ b/runtime/vm/compiler/stub_code_compiler_arm64.cc
@@ -1343,7 +1343,7 @@
__ ldr(TMP, Address(R3, target::Thread::invoke_dart_code_stub_offset()));
__ Push(TMP);
-#if defined(TARGET_OS_FUCHSIA)
+#if defined(DART_TARGET_OS_FUCHSIA)
__ str(R18, Address(R3, target::Thread::saved_shadow_call_stack_offset()));
#elif defined(USING_SHADOW_CALL_STACK)
#error Unimplemented
@@ -1378,7 +1378,7 @@
__ StoreToOffset(ZR, THR, target::Thread::top_exit_frame_info_offset());
// target::frame_layout.exit_link_slot_from_entry_fp must be kept in sync
// with the code below.
-#if defined(TARGET_OS_FUCHSIA)
+#if defined(DART_TARGET_OS_FUCHSIA)
ASSERT(target::frame_layout.exit_link_slot_from_entry_fp == -24);
#else
ASSERT(target::frame_layout.exit_link_slot_from_entry_fp == -23);
@@ -3068,7 +3068,7 @@
__ mov(FP, R2); // Frame_pointer.
__ mov(THR, R3);
__ SetupCSPFromThread(THR);
-#if defined(TARGET_OS_FUCHSIA)
+#if defined(DART_TARGET_OS_FUCHSIA)
__ ldr(R18, Address(THR, target::Thread::saved_shadow_call_stack_offset()));
#elif defined(USING_SHADOW_CALL_STACK)
#error Unimplemented
diff --git a/runtime/vm/compiler/stub_code_compiler_x64.cc b/runtime/vm/compiler/stub_code_compiler_x64.cc
index a3c3821..71c094c 100644
--- a/runtime/vm/compiler/stub_code_compiler_x64.cc
+++ b/runtime/vm/compiler/stub_code_compiler_x64.cc
@@ -121,7 +121,7 @@
Immediate(1 * target::kWordSize)); // Retval is next to 1st argument.
__ movq(Address(RSP, retval_offset),
RAX); // Set retval in target::NativeArguments.
-#if defined(TARGET_OS_WINDOWS)
+#if defined(DART_TARGET_OS_WINDOWS)
ASSERT(target::NativeArguments::StructSize() >
CallingConventions::kRegisterTransferLimit);
__ movq(CallingConventions::kArg1Reg, RSP);
diff --git a/runtime/vm/constants_arm.cc b/runtime/vm/constants_arm.cc
index 1903427..03e790f 100644
--- a/runtime/vm/constants_arm.cc
+++ b/runtime/vm/constants_arm.cc
@@ -13,7 +13,7 @@
using dart::bit_cast;
const char* const cpu_reg_names[kNumberOfCpuRegisters] = {
-#if defined(TARGET_OS_MACOS) || defined(TARGET_OS_MACOS_IOS)
+#if defined(DART_TARGET_OS_MACOS) || defined(DART_TARGET_OS_MACOS_IOS)
"r0", "r1", "r2", "r3", "r4", "pp", "r6", "fp",
"r8", "r9", "thr", "r11", "ip", "sp", "lr", "pc",
#else
diff --git a/runtime/vm/constants_arm.h b/runtime/vm/constants_arm.h
index a5f9f94..00f5670 100644
--- a/runtime/vm/constants_arm.h
+++ b/runtime/vm/constants_arm.h
@@ -99,7 +99,7 @@
kNoRegister = -1, // Signals an illegal register.
// Aliases.
-#if defined(TARGET_OS_MACOS) || defined(TARGET_OS_MACOS_IOS)
+#if defined(DART_TARGET_OS_MACOS) || defined(DART_TARGET_OS_MACOS_IOS)
FP = R7,
NOTFP = R11,
#else
@@ -505,7 +505,7 @@
// C++ ABI call registers.
const RegList kAbiArgumentCpuRegs =
(1 << R0) | (1 << R1) | (1 << R2) | (1 << R3);
-#if defined(TARGET_OS_MACOS) || defined(TARGET_OS_MACOS_IOS)
+#if defined(DART_TARGET_OS_MACOS) || defined(DART_TARGET_OS_MACOS_IOS)
const RegList kAbiPreservedCpuRegs =
(1 << R4) | (1 << R5) | (1 << R6) | (1 << R8) | (1 << R10) | (1 << R11);
const int kAbiPreservedCpuRegCount = 6;
@@ -532,7 +532,7 @@
// Registers available to Dart that are not preserved by runtime calls.
const RegList kDartVolatileCpuRegs =
kDartAvailableCpuRegs & ~kAbiPreservedCpuRegs;
-#if defined(TARGET_OS_MACOS) || defined(TARGET_OS_MACOS_IOS)
+#if defined(DART_TARGET_OS_MACOS) || defined(DART_TARGET_OS_MACOS_IOS)
const int kDartVolatileCpuRegCount = 6;
#else
const int kDartVolatileCpuRegCount = 5;
@@ -572,7 +572,7 @@
kAlignedToWordSizeBut8AlignedTo8;
// How fields in compounds are aligned.
-#if defined(TARGET_OS_MACOS_IOS)
+#if defined(DART_TARGET_OS_MACOS_IOS)
static constexpr AlignmentStrategy kFieldAlignment =
kAlignedToValueSizeBut8AlignedTo4;
#else
diff --git a/runtime/vm/constants_arm64.h b/runtime/vm/constants_arm64.h
index 61f2c4a..4700efa 100644
--- a/runtime/vm/constants_arm64.h
+++ b/runtime/vm/constants_arm64.h
@@ -356,7 +356,7 @@
// C++ ABI call registers.
const RegList kAbiArgumentCpuRegs =
R(R0) | R(R1) | R(R2) | R(R3) | R(R4) | R(R5) | R(R6) | R(R7);
-#if defined(TARGET_OS_FUCHSIA)
+#if defined(DART_TARGET_OS_FUCHSIA)
// We rely on R18 not being touched by Dart generated assembly or stubs at all.
// We rely on that any calls into C++ also preserve R18.
const RegList kAbiPreservedCpuRegs = R(R18) | R(R19) | R(R20) | R(R21) |
@@ -433,7 +433,7 @@
kAlignedToWordSize;
// How stack arguments are aligned.
-#if defined(TARGET_OS_MACOS_IOS) || defined(TARGET_OS_MACOS)
+#if defined(DART_TARGET_OS_MACOS_IOS) || defined(DART_TARGET_OS_MACOS)
// > Function arguments may consume slots on the stack that are not multiples
// > of 8 bytes.
// https://developer.apple.com/documentation/xcode/writing_arm64_code_for_apple_platforms
@@ -449,7 +449,7 @@
// Whether 1 or 2 byte-sized arguments or return values are passed extended
// to 4 bytes.
-#if defined(TARGET_OS_MACOS_IOS) || defined(TARGET_OS_MACOS)
+#if defined(DART_TARGET_OS_MACOS_IOS) || defined(DART_TARGET_OS_MACOS)
static constexpr ExtensionStrategy kReturnRegisterExtension = kExtendedTo4;
static constexpr ExtensionStrategy kArgumentRegisterExtension = kExtendedTo4;
#else
diff --git a/runtime/vm/constants_ia32.h b/runtime/vm/constants_ia32.h
index b83e196..e727643 100644
--- a/runtime/vm/constants_ia32.h
+++ b/runtime/vm/constants_ia32.h
@@ -345,7 +345,7 @@
kAlignedToWordSize;
// How fields in compounds are aligned.
-#if defined(TARGET_OS_WINDOWS)
+#if defined(DART_TARGET_OS_WINDOWS)
static constexpr AlignmentStrategy kFieldAlignment = kAlignedToValueSize;
#else
static constexpr AlignmentStrategy kFieldAlignment =
diff --git a/runtime/vm/constants_x64.cc b/runtime/vm/constants_x64.cc
index 6312a54..b80a77a 100644
--- a/runtime/vm/constants_x64.cc
+++ b/runtime/vm/constants_x64.cc
@@ -18,7 +18,7 @@
"xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7",
"xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15"};
-#if defined(TARGET_OS_WINDOWS)
+#if defined(DART_TARGET_OS_WINDOWS)
const Register CallingConventions::ArgumentRegisters[] = {
CallingConventions::kArg1Reg, CallingConventions::kArg2Reg,
CallingConventions::kArg3Reg, CallingConventions::kArg4Reg};
diff --git a/runtime/vm/constants_x64.h b/runtime/vm/constants_x64.h
index 7a3c9b7..6e7c80b 100644
--- a/runtime/vm/constants_x64.h
+++ b/runtime/vm/constants_x64.h
@@ -354,7 +354,7 @@
class CallingConventions {
public:
-#if defined(TARGET_OS_WINDOWS)
+#if defined(DART_TARGET_OS_WINDOWS)
static const Register kArg1Reg = RCX;
static const Register kArg2Reg = RDX;
static const Register kArg3Reg = R8;
diff --git a/runtime/vm/cpu_arm.cc b/runtime/vm/cpu_arm.cc
index f5f806a..ac65f6d 100644
--- a/runtime/vm/cpu_arm.cc
+++ b/runtime/vm/cpu_arm.cc
@@ -14,7 +14,7 @@
#include "vm/object.h"
#include "vm/simulator.h"
-#if defined(HOST_OS_IOS)
+#if defined(DART_HOST_OS_IOS)
#include <libkern/OSCacheControl.h>
#endif
@@ -57,7 +57,7 @@
"Use integer division instruction if supported");
#if defined(TARGET_HOST_MISMATCH)
-#if defined(TARGET_OS_ANDROID) || defined(TARGET_OS_MACOS_IOS)
+#if defined(DART_TARGET_OS_ANDROID) || defined(DART_TARGET_OS_MACOS_IOS)
DEFINE_FLAG(bool, sim_use_hardfp, false, "Use the hardfp ABI.");
#else
DEFINE_FLAG(bool, sim_use_hardfp, true, "Use the hardfp ABI.");
@@ -81,7 +81,7 @@
// On iOS we use sys_icache_invalidate from Darwin. See:
//
// https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/sys_icache_invalidate.3.html
-#if defined(HOST_OS_IOS)
+#if defined(DART_HOST_OS_IOS)
sys_icache_invalidate(reinterpret_cast<void*>(start), size);
#elif defined(__linux__) && !defined(ANDROID)
extern void __clear_cache(char*, char*);
@@ -115,7 +115,7 @@
#endif
#if !defined(TARGET_HOST_MISMATCH)
-#if HOST_OS_IOS
+#if DART_HOST_OS_IOS
void HostCPUFeatures::Init() {
// TODO(24743): Actually check the CPU features and fail if we're missing
// something assumed in a precompiled snapshot.
@@ -130,7 +130,7 @@
initialized_ = true;
#endif
}
-#else // HOST_OS_IOS
+#else // DART_HOST_OS_IOS
void HostCPUFeatures::Init() {
bool is_arm64 = false;
CpuInfo::Init();
@@ -171,7 +171,7 @@
CpuInfo::FieldContains(kCpuInfoHardware, "Marvell Armada 370/XP");
bool is_virtual_machine =
CpuInfo::FieldContains(kCpuInfoHardware, "Dummy Virtual Machine");
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
bool is_android = true;
#else
bool is_android = false;
@@ -213,7 +213,7 @@
initialized_ = true;
#endif
}
-#endif // HOST_OS_IOS
+#endif // DART_HOST_OS_IOS
void HostCPUFeatures::Cleanup() {
DEBUG_ASSERT(initialized_);
diff --git a/runtime/vm/cpu_arm64.cc b/runtime/vm/cpu_arm64.cc
index df0f48b..e27ac58 100644
--- a/runtime/vm/cpu_arm64.cc
+++ b/runtime/vm/cpu_arm64.cc
@@ -12,7 +12,7 @@
#include "vm/simulator.h"
#if !defined(USING_SIMULATOR)
-#if !defined(HOST_OS_FUCHSIA)
+#if !defined(DART_HOST_OS_FUCHSIA)
#include <sys/syscall.h>
#else
#include <zircon/syscalls.h>
@@ -20,7 +20,7 @@
#include <unistd.h>
#endif
-#if defined(HOST_OS_MACOS) || defined(HOST_OS_IOS)
+#if defined(DART_HOST_OS_MACOS) || defined(DART_HOST_OS_IOS)
#include <libkern/OSCacheControl.h>
#endif
@@ -42,14 +42,14 @@
// On iOS we use sys_icache_invalidate from Darwin. See:
//
// https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/sys_icache_invalidate.3.html
-#if defined(HOST_OS_MACOS) || defined(HOST_OS_IOS)
+#if defined(DART_HOST_OS_MACOS) || defined(DART_HOST_OS_IOS)
sys_icache_invalidate(reinterpret_cast<void*>(start), size);
-#elif defined(HOST_OS_ANDROID) || defined(HOST_OS_LINUX)
+#elif defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_LINUX)
extern void __clear_cache(char*, char*);
char* beg = reinterpret_cast<char*>(start);
char* end = reinterpret_cast<char*>(start + size);
::__clear_cache(beg, end);
-#elif defined(HOST_OS_FUCHSIA)
+#elif defined(DART_HOST_OS_FUCHSIA)
zx_status_t result = zx_cache_flush(reinterpret_cast<const void*>(start),
size, ZX_CACHE_FLUSH_INSN);
ASSERT(result == ZX_OK);
diff --git a/runtime/vm/cpuid.cc b/runtime/vm/cpuid.cc
index dddd15a..0541712 100644
--- a/runtime/vm/cpuid.cc
+++ b/runtime/vm/cpuid.cc
@@ -3,12 +3,12 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h"
-#if !defined(HOST_OS_MACOS)
+#if !defined(DART_HOST_OS_MACOS)
#include "vm/cpuid.h"
#if defined(HOST_ARCH_IA32) || defined(HOST_ARCH_X64)
// GetCpuId() on Windows, __get_cpuid() on Linux
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#include <intrin.h> // NOLINT
#else
#include <cpuid.h> // NOLINT
@@ -28,7 +28,7 @@
#if defined(HOST_ARCH_IA32) || defined(HOST_ARCH_X64)
void CpuId::GetCpuId(int32_t level, uint32_t info[4]) {
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
// The documentation for __cpuid is at:
// http://msdn.microsoft.com/en-us/library/hskdteyh(v=vs.90).aspx
__cpuid(reinterpret_cast<int*>(info), level);
@@ -127,4 +127,4 @@
#endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
} // namespace dart
-#endif // !defined(HOST_OS_MACOS)
+#endif // !defined(DART_HOST_OS_MACOS)
diff --git a/runtime/vm/cpuid.h b/runtime/vm/cpuid.h
index 99f4f34..abb4fdc 100644
--- a/runtime/vm/cpuid.h
+++ b/runtime/vm/cpuid.h
@@ -6,7 +6,7 @@
#define RUNTIME_VM_CPUID_H_
#include "vm/globals.h"
-#if !defined(HOST_OS_MACOS)
+#if !defined(DART_HOST_OS_MACOS)
#include "vm/allocation.h"
#include "vm/cpuinfo.h"
@@ -48,5 +48,5 @@
} // namespace dart
-#endif // !defined(HOST_OS_MACOS)
+#endif // !defined(DART_HOST_OS_MACOS)
#endif // RUNTIME_VM_CPUID_H_
diff --git a/runtime/vm/cpuinfo_android.cc b/runtime/vm/cpuinfo_android.cc
index 0807dfd..8c34f61 100644
--- a/runtime/vm/cpuinfo_android.cc
+++ b/runtime/vm/cpuinfo_android.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h"
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
#include "vm/cpuinfo.h"
#include "vm/proccpuinfo.h"
@@ -58,4 +58,4 @@
} // namespace dart
-#endif // defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_ANDROID)
diff --git a/runtime/vm/cpuinfo_fuchsia.cc b/runtime/vm/cpuinfo_fuchsia.cc
index d5d88cf..ca197c3 100644
--- a/runtime/vm/cpuinfo_fuchsia.cc
+++ b/runtime/vm/cpuinfo_fuchsia.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h"
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
#include "vm/cpuinfo.h"
@@ -66,4 +66,4 @@
} // namespace dart
-#endif // defined(HOST_OS_FUCHSIA)
+#endif // defined(DART_HOST_OS_FUCHSIA)
diff --git a/runtime/vm/cpuinfo_linux.cc b/runtime/vm/cpuinfo_linux.cc
index 0c4fc99..08621ed 100644
--- a/runtime/vm/cpuinfo_linux.cc
+++ b/runtime/vm/cpuinfo_linux.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h"
-#if defined(HOST_OS_LINUX)
+#if defined(DART_HOST_OS_LINUX)
#include "vm/cpuid.h"
#include "vm/cpuinfo.h"
@@ -94,4 +94,4 @@
} // namespace dart
-#endif // defined(HOST_OS_LINUX)
+#endif // defined(DART_HOST_OS_LINUX)
diff --git a/runtime/vm/cpuinfo_macos.cc b/runtime/vm/cpuinfo_macos.cc
index cbc66f4..4596813 100644
--- a/runtime/vm/cpuinfo_macos.cc
+++ b/runtime/vm/cpuinfo_macos.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h"
-#if defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_MACOS)
#include "vm/cpuinfo.h"
@@ -76,4 +76,4 @@
} // namespace dart
-#endif // defined(HOST_OS_MACOS)
+#endif // defined(DART_HOST_OS_MACOS)
diff --git a/runtime/vm/cpuinfo_win.cc b/runtime/vm/cpuinfo_win.cc
index 5e5601e..2a8ad21 100644
--- a/runtime/vm/cpuinfo_win.cc
+++ b/runtime/vm/cpuinfo_win.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h"
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#include "vm/cpuid.h"
#include "vm/cpuinfo.h"
@@ -56,4 +56,4 @@
} // namespace dart
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
diff --git a/runtime/vm/dart.cc b/runtime/vm/dart.cc
index b2601a5..2fbb323 100644
--- a/runtime/vm/dart.cc
+++ b/runtime/vm/dart.cc
@@ -977,7 +977,7 @@
// Generated code must match the host architecture and ABI.
#if defined(TARGET_ARCH_ARM)
-#if defined(TARGET_OS_MACOS) || defined(TARGET_OS_MACOS_IOS)
+#if defined(DART_TARGET_OS_MACOS) || defined(DART_TARGET_OS_MACOS_IOS)
buffer.AddString(" arm-ios");
#else
buffer.AddString(" arm-eabi");
@@ -985,7 +985,7 @@
buffer.AddString(TargetCPUFeatures::hardfp_supported() ? " hardfp"
: " softfp");
#elif defined(TARGET_ARCH_ARM64)
-#if defined(TARGET_OS_FUCHSIA)
+#if defined(DART_TARGET_OS_FUCHSIA)
// See signal handler cheat in Assembler::EnterFrame.
buffer.AddString(" arm64-fuchsia");
#else
@@ -994,7 +994,7 @@
#elif defined(TARGET_ARCH_IA32)
buffer.AddString(" ia32");
#elif defined(TARGET_ARCH_X64)
-#if defined(TARGET_OS_WINDOWS)
+#if defined(DART_TARGET_OS_WINDOWS)
buffer.AddString(" x64-win");
#else
buffer.AddString(" x64-sysv");
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index db08698..756db27 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -6593,7 +6593,7 @@
void* debug_callback_data) {
#if defined(TARGET_ARCH_IA32)
return Api::NewError("AOT compilation is not supported on IA32.");
-#elif defined(TARGET_OS_WINDOWS)
+#elif defined(DART_TARGET_OS_WINDOWS)
return Api::NewError("Assembly generation is not implemented for Windows.");
#elif !defined(DART_PRECOMPILER)
return Api::NewError(
@@ -6621,7 +6621,7 @@
Dart_StreamingCloseCallback close_callback) {
#if defined(TARGET_ARCH_IA32)
return Api::NewError("AOT compilation is not supported on IA32.");
-#elif defined(TARGET_OS_WINDOWS)
+#elif defined(DART_TARGET_OS_WINDOWS)
return Api::NewError("Assembly generation is not implemented for Windows.");
#elif !defined(DART_PRECOMPILER)
return Api::NewError(
@@ -6645,7 +6645,7 @@
void* callback_data) {
#if defined(TARGET_ARCH_IA32)
return Api::NewError("AOT compilation is not supported on IA32.");
-#elif defined(TARGET_OS_WINDOWS)
+#elif defined(DART_TARGET_OS_WINDOWS)
return Api::NewError("Assembly generation is not implemented for Windows.");
#elif !defined(DART_PRECOMPILER)
return Api::NewError(
diff --git a/runtime/vm/dwarf.cc b/runtime/vm/dwarf.cc
index 53d6b39..000bab4c 100644
--- a/runtime/vm/dwarf.cc
+++ b/runtime/vm/dwarf.cc
@@ -778,7 +778,7 @@
const intptr_t len = strlen(str);
if (len > kResolvedFileRootLen &&
strncmp(str, kResolvedFileRoot, kResolvedFileRootLen) == 0) {
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
return str + kResolvedFileRootLen; // Strip off the entire prefix.
#else
return str + kResolvedFileRootLen - 1; // Leave a '/' on the front.
diff --git a/runtime/vm/globals.h b/runtime/vm/globals.h
index d7426c4..d3ac9ab 100644
--- a/runtime/vm/globals.h
+++ b/runtime/vm/globals.h
@@ -108,7 +108,8 @@
#define NOT_IN_PRECOMPILED_RUNTIME(code) code
#endif // defined(DART_PRECOMPILED_RUNTIME)
-#if !defined(PRODUCT) || defined(HOST_OS_FUCHSIA) || defined(TARGET_OS_FUCHSIA)
+#if !defined(PRODUCT) || defined(DART_HOST_OS_FUCHSIA) || \
+ defined(DART_TARGET_OS_FUCHSIA)
#define SUPPORT_TIMELINE 1
#endif
@@ -156,7 +157,7 @@
// When using GCC we can use GCC attributes to ensure that certain
// constants are 8 or 16 byte aligned.
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#define ALIGN8 __declspec(align(8))
#define ALIGN16 __declspec(align(16))
#else
@@ -172,7 +173,7 @@
#endif
// Macros to get the contents of the fp register.
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
// clang-format off
#if defined(HOST_ARCH_IA32)
@@ -188,13 +189,13 @@
#error Unknown host architecture.
#endif
-#else // !defined(HOST_OS_WINDOWS))
+#else // !defined(DART_HOST_OS_WINDOWS))
// Assume GCC-compatible builtins.
#define COPY_FP_REGISTER(fp) \
fp = reinterpret_cast<uintptr_t>(__builtin_frame_address(0));
-#endif // !defined(HOST_OS_WINDOWS))
+#endif // !defined(DART_HOST_OS_WINDOWS))
#if defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_ARM64) || \
defined(TARGET_ARCH_X64)
diff --git a/runtime/vm/image_snapshot.cc b/runtime/vm/image_snapshot.cc
index dd69383..658892b 100644
--- a/runtime/vm/image_snapshot.cc
+++ b/runtime/vm/image_snapshot.cc
@@ -951,20 +951,20 @@
// Methods for writing the assembly prologues for various DWARF sections.
void AbbreviationsPrologue() {
-#if defined(TARGET_OS_MACOS) || defined(TARGET_OS_MACOS_IOS)
+#if defined(DART_TARGET_OS_MACOS) || defined(DART_TARGET_OS_MACOS_IOS)
stream_->WriteString(".section __DWARF,__debug_abbrev,regular,debug\n");
-#elif defined(TARGET_OS_LINUX) || defined(TARGET_OS_ANDROID) || \
- defined(TARGET_OS_FUCHSIA)
+#elif defined(DART_TARGET_OS_LINUX) || defined(DART_TARGET_OS_ANDROID) || \
+ defined(DART_TARGET_OS_FUCHSIA)
stream_->WriteString(".section .debug_abbrev,\"\"\n");
#else
UNIMPLEMENTED();
#endif
}
void DebugInfoPrologue() {
-#if defined(TARGET_OS_MACOS) || defined(TARGET_OS_MACOS_IOS)
+#if defined(DART_TARGET_OS_MACOS) || defined(DART_TARGET_OS_MACOS_IOS)
stream_->WriteString(".section __DWARF,__debug_info,regular,debug\n");
-#elif defined(TARGET_OS_LINUX) || defined(TARGET_OS_ANDROID) || \
- defined(TARGET_OS_FUCHSIA)
+#elif defined(DART_TARGET_OS_LINUX) || defined(DART_TARGET_OS_ANDROID) || \
+ defined(DART_TARGET_OS_FUCHSIA)
stream_->WriteString(".section .debug_info,\"\"\n");
#else
UNIMPLEMENTED();
@@ -973,10 +973,10 @@
stream_->Printf("%s:\n", kDebugInfoLabel);
}
void LineNumberProgramPrologue() {
-#if defined(TARGET_OS_MACOS) || defined(TARGET_OS_MACOS_IOS)
+#if defined(DART_TARGET_OS_MACOS) || defined(DART_TARGET_OS_MACOS_IOS)
stream_->WriteString(".section __DWARF,__debug_line,regular,debug\n");
-#elif defined(TARGET_OS_LINUX) || defined(TARGET_OS_ANDROID) || \
- defined(TARGET_OS_FUCHSIA)
+#elif defined(DART_TARGET_OS_LINUX) || defined(DART_TARGET_OS_ANDROID) || \
+ defined(DART_TARGET_OS_FUCHSIA)
stream_->WriteString(".section .debug_line,\"\"\n");
#else
UNIMPLEMENTED();
@@ -1131,10 +1131,10 @@
current_symbols_ =
new (zone_) ZoneGrowableArray<Elf::SymbolData>(zone_, 0);
}
-#if defined(TARGET_OS_LINUX) || defined(TARGET_OS_ANDROID) || \
- defined(TARGET_OS_FUCHSIA)
+#if defined(DART_TARGET_OS_LINUX) || defined(DART_TARGET_OS_ANDROID) || \
+ defined(DART_TARGET_OS_FUCHSIA)
assembly_stream_->WriteString(".section .rodata\n");
-#elif defined(TARGET_OS_MACOS) || defined(TARGET_OS_MACOS_IOS)
+#elif defined(DART_TARGET_OS_MACOS) || defined(DART_TARGET_OS_MACOS_IOS)
assembly_stream_->WriteString(".const\n");
#else
UNIMPLEMENTED();
@@ -1308,7 +1308,7 @@
// newer than late 2016. Can't emit .cfi_value_offset using .cfi_scape
// because DW_CFA_val_offset uses scaled operand and we don't know what
// data alignment factor will be choosen by the assembler when emitting CIE.
-#if defined(TARGET_OS_ANDROID)
+#if defined(DART_TARGET_OS_ANDROID)
// On Android libunwindstack has a bug (b/191113792): it does not push
// CFA value to the expression stack before evaluating expression given
// to DW_CFA_expression. We have to workaround this bug by manually pushing
@@ -1331,7 +1331,7 @@
#endif
#elif defined(TARGET_ARCH_ARM)
-#if defined(TARGET_OS_MACOS) || defined(TARGET_OS_MACOS_IOS)
+#if defined(DART_TARGET_OS_MACOS) || defined(DART_TARGET_OS_MACOS_IOS)
COMPILE_ASSERT(FP == R7);
assembly_stream_->WriteString(".cfi_def_cfa r7, 0\n"); // CFA is fp+0
assembly_stream_->WriteString(".cfi_offset r7, 0\n"); // saved fp is *(CFA+0)
@@ -1347,7 +1347,7 @@
// newer than late 2016. Can't emit .cfi_value_offset using .cfi_scape
// because DW_CFA_val_offset uses scaled operand and we don't know what
// data alignment factor will be choosen by the assembler when emitting CIE.
-#if defined(TARGET_OS_ANDROID)
+#if defined(DART_TARGET_OS_ANDROID)
// On Android libunwindstack has a bug (b/191113792): it does not push
// CFA value to the expression stack before evaluating expression given
// to DW_CFA_expression. We have to workaround this bug by manually pushing
@@ -1370,7 +1370,7 @@
#endif
// libunwind on ARM may use .ARM.exidx instead of .debug_frame
-#if !defined(TARGET_OS_MACOS) && !defined(TARGET_OS_MACOS_IOS)
+#if !defined(DART_TARGET_OS_MACOS) && !defined(DART_TARGET_OS_MACOS_IOS)
COMPILE_ASSERT(FP == R11);
assembly_stream_->WriteString(".fnstart\n");
assembly_stream_->WriteString(".save {r11, lr}\n");
@@ -1381,7 +1381,7 @@
void AssemblyImageWriter::FrameUnwindEpilogue() {
#if defined(TARGET_ARCH_ARM)
-#if !defined(TARGET_OS_MACOS) && !defined(TARGET_OS_MACOS_IOS)
+#if !defined(DART_TARGET_OS_MACOS) && !defined(DART_TARGET_OS_MACOS_IOS)
assembly_stream_->WriteString(".fnend\n");
#endif
#endif
diff --git a/runtime/vm/malloc_hooks_unsupported.cc b/runtime/vm/malloc_hooks_unsupported.cc
index d28100f..9650cff 100644
--- a/runtime/vm/malloc_hooks_unsupported.cc
+++ b/runtime/vm/malloc_hooks_unsupported.cc
@@ -10,13 +10,13 @@
#include "vm/json_stream.h"
-#if defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)
#include <malloc.h>
-#elif defined(HOST_OS_MACOS)
+#elif defined(DART_HOST_OS_MACOS)
#include <malloc/malloc.h>
#endif
-#if !defined(HOST_OS_WINDOWS) && !defined(TARGET_OS_IOS)
+#if !defined(DART_HOST_OS_WINDOWS) && !defined(DART_HOST_OS_MACOS)
extern "C" {
__attribute__((weak)) uintptr_t __sanitizer_get_current_allocated_bytes();
__attribute__((weak)) uintptr_t __sanitizer_get_heap_size();
@@ -60,7 +60,7 @@
intptr_t* capacity,
const char** implementation) {
#if !defined(PRODUCT)
-#if !defined(HOST_OS_WINDOWS) && !defined(TARGET_OS_IOS)
+#if !defined(DART_HOST_OS_WINDOWS) && !defined(DART_HOST_OS_MACOS)
if (__sanitizer_get_current_allocated_bytes != nullptr &&
__sanitizer_get_heap_size != nullptr) {
*used = __sanitizer_get_current_allocated_bytes();
@@ -69,13 +69,13 @@
return true;
}
#endif
-#if defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)
struct mallinfo info = mallinfo();
*used = info.uordblks;
*capacity = *used + info.fordblks;
*implementation = "unknown";
return true;
-#elif defined(HOST_OS_MACOS)
+#elif defined(DART_HOST_OS_MACOS)
struct mstats stats = mstats();
*used = stats.bytes_used;
*capacity = stats.bytes_total;
diff --git a/runtime/vm/native_arguments.h b/runtime/vm/native_arguments.h
index 5b206ed..d2df92c 100644
--- a/runtime/vm/native_arguments.h
+++ b/runtime/vm/native_arguments.h
@@ -27,7 +27,7 @@
uword current_sp = Simulator::Current()->get_register(SPREG); \
ASSERT(Utils::IsAligned(current_sp, OS::ActivationFrameAlignment())); \
}
-#elif defined(HOST_OS_WINDOWS)
+#elif defined(DART_HOST_OS_WINDOWS)
// The compiler may dynamically align the stack on Windows, so do not check.
#define CHECK_STACK_ALIGNMENT \
{}
diff --git a/runtime/vm/native_symbol_android.cc b/runtime/vm/native_symbol_android.cc
index 9d0c245..d7837e3 100644
--- a/runtime/vm/native_symbol_android.cc
+++ b/runtime/vm/native_symbol_android.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
#include "vm/native_symbol.h"
#include "vm/os.h"
@@ -68,4 +68,4 @@
} // namespace dart
-#endif // defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_ANDROID)
diff --git a/runtime/vm/native_symbol_fuchsia.cc b/runtime/vm/native_symbol_fuchsia.cc
index 12b9249..1cb72a8 100644
--- a/runtime/vm/native_symbol_fuchsia.cc
+++ b/runtime/vm/native_symbol_fuchsia.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h"
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
#include "platform/memory_sanitizer.h"
#include "vm/native_symbol.h"
@@ -157,4 +157,4 @@
} // namespace dart
-#endif // defined(HOST_OS_FUCHSIA)
+#endif // defined(DART_HOST_OS_FUCHSIA)
diff --git a/runtime/vm/native_symbol_linux.cc b/runtime/vm/native_symbol_linux.cc
index 158a2af..7557890 100644
--- a/runtime/vm/native_symbol_linux.cc
+++ b/runtime/vm/native_symbol_linux.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h"
-#if defined(HOST_OS_LINUX)
+#if defined(DART_HOST_OS_LINUX)
#include "platform/memory_sanitizer.h"
#include "vm/native_symbol.h"
@@ -69,4 +69,4 @@
} // namespace dart
-#endif // defined(HOST_OS_LINUX)
+#endif // defined(DART_HOST_OS_LINUX)
diff --git a/runtime/vm/native_symbol_macos.cc b/runtime/vm/native_symbol_macos.cc
index 262bac5..aa1fc6c 100644
--- a/runtime/vm/native_symbol_macos.cc
+++ b/runtime/vm/native_symbol_macos.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h"
-#if defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_MACOS)
#include "vm/native_symbol.h"
#include "vm/os.h"
@@ -66,4 +66,4 @@
} // namespace dart
-#endif // defined(HOST_OS_MACOS)
+#endif // defined(DART_HOST_OS_MACOS)
diff --git a/runtime/vm/native_symbol_win.cc b/runtime/vm/native_symbol_win.cc
index 9ddc3a4..db48485 100644
--- a/runtime/vm/native_symbol_win.cc
+++ b/runtime/vm/native_symbol_win.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h"
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#include "vm/lockers.h"
#include "vm/native_symbol.h"
@@ -26,7 +26,7 @@
// Symbol resolution API's used in this file are not supported
// when compiled in UWP.
-#ifndef TARGET_OS_WINDOWS_UWP
+#ifndef DART_TARGET_OS_WINDOWS_UWP
SymSetOptions(SYMOPT_UNDNAME | SYMOPT_DEFERRED_LOADS);
HANDLE hProcess = GetCurrentProcess();
if (!SymInitialize(hProcess, NULL, TRUE)) {
@@ -45,7 +45,7 @@
return;
}
running_ = false;
-#ifndef TARGET_OS_WINDOWS_UWP
+#ifndef DART_TARGET_OS_WINDOWS_UWP
HANDLE hProcess = GetCurrentProcess();
if (!SymCleanup(hProcess)) {
DWORD error = GetLastError();
@@ -57,7 +57,7 @@
}
char* NativeSymbolResolver::LookupSymbolName(uword pc, uword* start) {
-#ifdef TARGET_OS_WINDOWS_UWP
+#ifdef DART_TARGET_OS_WINDOWS_UWP
return NULL;
#else
static const intptr_t kMaxNameLength = 2048;
@@ -86,7 +86,7 @@
*start = pc - displacement;
}
return Utils::StrDup(pSymbol->Name);
-#endif // ifdef TARGET_OS_WINDOWS_UWP
+#endif // ifdef DART_TARGET_OS_WINDOWS_UWP
}
void NativeSymbolResolver::FreeSymbolName(char* name) {
@@ -107,4 +107,4 @@
} // namespace dart
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
diff --git a/runtime/vm/os_android.cc b/runtime/vm/os_android.cc
index 10ad9cf..3a32eec 100644
--- a/runtime/vm/os_android.cc
+++ b/runtime/vm/os_android.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h"
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
#include "vm/os.h"
@@ -349,4 +349,4 @@
} // namespace dart
-#endif // defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_ANDROID)
diff --git a/runtime/vm/os_fuchsia.cc b/runtime/vm/os_fuchsia.cc
index 46c4303..448a10b 100644
--- a/runtime/vm/os_fuchsia.cc
+++ b/runtime/vm/os_fuchsia.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h"
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
#include "vm/os.h"
@@ -638,4 +638,4 @@
} // namespace dart
-#endif // defined(HOST_OS_FUCHSIA)
+#endif // defined(DART_HOST_OS_FUCHSIA)
diff --git a/runtime/vm/os_linux.cc b/runtime/vm/os_linux.cc
index 9cbb507..5d78dc1 100644
--- a/runtime/vm/os_linux.cc
+++ b/runtime/vm/os_linux.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h"
-#if defined(HOST_OS_LINUX)
+#if defined(DART_HOST_OS_LINUX)
#include "vm/os.h"
@@ -660,4 +660,4 @@
} // namespace dart
-#endif // defined(HOST_OS_LINUX)
+#endif // defined(DART_HOST_OS_LINUX)
diff --git a/runtime/vm/os_macos.cc b/runtime/vm/os_macos.cc
index 0a7e529..eed635d 100644
--- a/runtime/vm/os_macos.cc
+++ b/runtime/vm/os_macos.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h"
-#if defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_MACOS)
#include "vm/os.h"
@@ -15,7 +15,7 @@
#include <sys/resource.h> // NOLINT
#include <sys/time.h> // NOLINT
#include <unistd.h> // NOLINT
-#if HOST_OS_IOS
+#if DART_HOST_OS_IOS
#include <syslog.h> // NOLINT
#endif
@@ -26,7 +26,7 @@
namespace dart {
const char* OS::Name() {
-#if HOST_OS_IOS
+#if DART_HOST_OS_IOS
return "ios";
#else
return "macos";
@@ -126,7 +126,7 @@
}
intptr_t OS::ActivationFrameAlignment() {
-#if HOST_OS_IOS
+#if DART_HOST_OS_IOS
#if TARGET_ARCH_ARM
// Even if we generate code that maintains a stronger alignment, we cannot
// assert the stronger stack alignment because C++ code will not maintain it.
@@ -140,11 +140,11 @@
#else
#error Unimplemented
#endif
-#else // HOST_OS_IOS
+#else // DART_HOST_OS_IOS
// OS X activation frames must be 16 byte-aligned; see "Mac OS X ABI
// Function Call Guide".
return 16;
-#endif // HOST_OS_IOS
+#endif // DART_HOST_OS_IOS
}
int OS::NumberOfAvailableProcessors() {
@@ -190,7 +190,7 @@
}
void OS::Print(const char* format, ...) {
-#if HOST_OS_IOS
+#if DART_HOST_OS_IOS
va_list args;
va_start(args, format);
vsyslog(LOG_INFO, format, args);
@@ -267,7 +267,7 @@
void OS::RegisterCodeObservers() {}
void OS::PrintErr(const char* format, ...) {
-#if HOST_OS_IOS
+#if DART_HOST_OS_IOS
va_list args;
va_start(args, format);
vsyslog(LOG_ERR, format, args);
@@ -312,4 +312,4 @@
} // namespace dart
-#endif // defined(HOST_OS_MACOS)
+#endif // defined(DART_HOST_OS_MACOS)
diff --git a/runtime/vm/os_thread.h b/runtime/vm/os_thread.h
index edd66f5..dca5003 100644
--- a/runtime/vm/os_thread.h
+++ b/runtime/vm/os_thread.h
@@ -13,20 +13,20 @@
#include "vm/globals.h"
// On iOS, thread_local requires iOS 9+.
-#if !HOST_OS_IOS
+#if !DART_HOST_OS_IOS
#define HAS_C11_THREAD_LOCAL 1
#endif
// Declare the OS-specific types ahead of defining the generic classes.
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
#include "vm/os_thread_android.h"
-#elif defined(HOST_OS_FUCHSIA)
+#elif defined(DART_HOST_OS_FUCHSIA)
#include "vm/os_thread_fuchsia.h"
-#elif defined(HOST_OS_LINUX)
+#elif defined(DART_HOST_OS_LINUX)
#include "vm/os_thread_linux.h"
-#elif defined(HOST_OS_MACOS)
+#elif defined(DART_HOST_OS_MACOS)
#include "vm/os_thread_macos.h"
-#elif defined(HOST_OS_WINDOWS)
+#elif defined(DART_HOST_OS_WINDOWS)
#include "vm/os_thread_win.h"
#else
#error Unknown target os.
diff --git a/runtime/vm/os_thread_android.cc b/runtime/vm/os_thread_android.cc
index cff8378..df257e3 100644
--- a/runtime/vm/os_thread_android.cc
+++ b/runtime/vm/os_thread_android.cc
@@ -4,7 +4,7 @@
#include "platform/globals.h" // NOLINT
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
#include "vm/os_thread.h"
@@ -490,4 +490,4 @@
} // namespace dart
-#endif // defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_ANDROID)
diff --git a/runtime/vm/os_thread_fuchsia.cc b/runtime/vm/os_thread_fuchsia.cc
index 9108f5d..1eb8a3a 100644
--- a/runtime/vm/os_thread_fuchsia.cc
+++ b/runtime/vm/os_thread_fuchsia.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h" // NOLINT
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
#include "vm/os.h"
#include "vm/os_thread.h"
@@ -492,4 +492,4 @@
} // namespace dart
-#endif // defined(HOST_OS_FUCHSIA)
+#endif // defined(DART_HOST_OS_FUCHSIA)
diff --git a/runtime/vm/os_thread_linux.cc b/runtime/vm/os_thread_linux.cc
index 053736d..167721a 100644
--- a/runtime/vm/os_thread_linux.cc
+++ b/runtime/vm/os_thread_linux.cc
@@ -4,7 +4,7 @@
#include "platform/globals.h" // NOLINT
-#if defined(HOST_OS_LINUX)
+#if defined(DART_HOST_OS_LINUX)
#include "vm/os_thread.h"
@@ -496,4 +496,4 @@
} // namespace dart
-#endif // defined(HOST_OS_LINUX)
+#endif // defined(DART_HOST_OS_LINUX)
diff --git a/runtime/vm/os_thread_macos.cc b/runtime/vm/os_thread_macos.cc
index e24ce12..401fdc7 100644
--- a/runtime/vm/os_thread_macos.cc
+++ b/runtime/vm/os_thread_macos.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h" // NOLINT
-#if defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_MACOS)
#include "vm/os_thread.h"
@@ -459,4 +459,4 @@
} // namespace dart
-#endif // defined(HOST_OS_MACOS)
+#endif // defined(DART_HOST_OS_MACOS)
diff --git a/runtime/vm/os_thread_win.cc b/runtime/vm/os_thread_win.cc
index 7c2f9b2..8b859a8 100644
--- a/runtime/vm/os_thread_win.cc
+++ b/runtime/vm/os_thread_win.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h" // NOLINT
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#include "vm/growable_array.h"
#include "vm/lockers.h"
@@ -530,4 +530,4 @@
#endif // _WIN64
} // extern "C"
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
diff --git a/runtime/vm/os_win.cc b/runtime/vm/os_win.cc
index da2d6f7..3eb9be0 100644
--- a/runtime/vm/os_win.cc
+++ b/runtime/vm/os_win.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h"
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#include "vm/os.h"
@@ -348,4 +348,4 @@
} // namespace dart
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
diff --git a/runtime/vm/proccpuinfo.cc b/runtime/vm/proccpuinfo.cc
index 6278627..066e3f7 100644
--- a/runtime/vm/proccpuinfo.cc
+++ b/runtime/vm/proccpuinfo.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h"
-#if defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)
#include "vm/proccpuinfo.h"
@@ -146,4 +146,4 @@
} // namespace dart
-#endif // defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)
diff --git a/runtime/vm/proccpuinfo.h b/runtime/vm/proccpuinfo.h
index 02ee2bf..ff249d4 100644
--- a/runtime/vm/proccpuinfo.h
+++ b/runtime/vm/proccpuinfo.h
@@ -6,7 +6,7 @@
#define RUNTIME_VM_PROCCPUINFO_H_
#include "vm/globals.h"
-#if defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)
#include "vm/allocation.h"
@@ -29,6 +29,6 @@
} // namespace dart
-#endif // defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)
#endif // RUNTIME_VM_PROCCPUINFO_H_
diff --git a/runtime/vm/profiler.cc b/runtime/vm/profiler.cc
index 568c78a..532eb63 100644
--- a/runtime/vm/profiler.cc
+++ b/runtime/vm/profiler.cc
@@ -797,7 +797,7 @@
}
}
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
// On Windows this code is synchronously executed from the thread interrupter
// thread. This means we can safely have a static fault_address.
static uword fault_address = 0;
@@ -826,7 +826,7 @@
uword sp,
ProfilerCounters* counters) {
ASSERT(counters != NULL);
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
// Use structured exception handling to trap guard page access on Windows.
__try {
#endif
@@ -854,7 +854,7 @@
sample->SetAt(0, pc);
}
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
// Use structured exception handling to trap guard page access.
} __except (GuardPageExceptionFilter(GetExceptionInformation())) { // NOLINT
// Sample collection triggered a guard page fault:
@@ -1013,14 +1013,15 @@
DumpStackTrace(/*for_crash=*/true);
return;
}
-#if defined(HOST_OS_LINUX) || defined(HOST_OS_MACOS) || defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOS) || \
+ defined(DART_HOST_OS_ANDROID)
ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context);
mcontext_t mcontext = ucontext->uc_mcontext;
uword pc = SignalHandler::GetProgramCounter(mcontext);
uword fp = SignalHandler::GetFramePointer(mcontext);
uword sp = SignalHandler::GetCStackPointer(mcontext);
DumpStackTrace(sp, fp, pc, /*for_crash=*/true);
-#elif defined(HOST_OS_WINDOWS)
+#elif defined(DART_HOST_OS_WINDOWS)
CONTEXT* ctx = reinterpret_cast<CONTEXT*>(context);
#if defined(HOST_ARCH_IA32)
uword pc = static_cast<uword>(ctx->Eip);
diff --git a/runtime/vm/profiler_test.cc b/runtime/vm/profiler_test.cc
index 5d6bd68..1829169 100644
--- a/runtime/vm/profiler_test.cc
+++ b/runtime/vm/profiler_test.cc
@@ -478,8 +478,8 @@
}
}
-#if defined(DART_USE_TCMALLOC) && defined(HOST_OS_LINUX) && defined(DEBUG) && \
- defined(HOST_ARCH_X64)
+#if defined(DART_USE_TCMALLOC) && defined(DART_HOST_OS_LINUX) && \
+ defined(DEBUG) && defined(HOST_ARCH_X64)
DART_NOINLINE static void NativeAllocationSampleHelper(char** result) {
ASSERT(result != NULL);
@@ -584,7 +584,7 @@
stack_trace_collection_enabled);
FLAG_profiler_native_memory = enable_malloc_hooks_saved;
}
-#endif // defined(DART_USE_TCMALLOC) && defined(HOST_OS_LINUX) && \
+#endif // defined(DART_USE_TCMALLOC) && defined(DART_HOST_OS_LINUX) && \
// defined(DEBUG) && defined(HOST_ARCH_X64)
ISOLATE_UNIT_TEST_CASE(Profiler_ToggleRecordAllocation) {
diff --git a/runtime/vm/runtime_entry.cc b/runtime/vm/runtime_entry.cc
index 2cd5a19..c7305ca 100644
--- a/runtime/vm/runtime_entry.cc
+++ b/runtime/vm/runtime_entry.cc
@@ -3595,7 +3595,7 @@
return thread;
}
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#pragma intrinsic(_ReturnAddress)
#endif
@@ -3606,7 +3606,7 @@
extern "C" Thread* DLRT_GetThreadForNativeCallback(uword callback_id) {
CHECK_STACK_ALIGNMENT;
TRACE_RUNTIME_CALL("GetThreadForNativeCallback %" Pd, callback_id);
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
void* return_address = _ReturnAddress();
#else
void* return_address = __builtin_return_address(0);
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
index 804ca50..51d5a00 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -4238,7 +4238,7 @@
PrintSuccess(js);
}
-#if defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)
struct VMMapping {
char path[256];
size_t size;
@@ -4404,7 +4404,7 @@
}
// On Android, malloc is better labeled by /proc/self/smaps.
-#if !defined(HOST_OS_ANDROID)
+#if !defined(DART_HOST_OS_ANDROID)
intptr_t used, capacity;
const char* implementation;
if (MallocHooks::GetStats(&used, &capacity, &implementation)) {
@@ -4432,7 +4432,7 @@
}
#endif
-#if defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)
AddVMMappings(&rss_children);
#endif
// TODO(46166): Implement for other operating systems.
diff --git a/runtime/vm/signal_handler.h b/runtime/vm/signal_handler.h
index 41eea90..22821d3 100644
--- a/runtime/vm/signal_handler.h
+++ b/runtime/vm/signal_handler.h
@@ -8,10 +8,10 @@
#include "vm/allocation.h"
#include "vm/globals.h"
-#if defined(HOST_OS_LINUX)
+#if defined(DART_HOST_OS_LINUX)
#include <signal.h> // NOLINT
#include <ucontext.h> // NOLINT
-#elif defined(HOST_OS_ANDROID)
+#elif defined(DART_HOST_OS_ANDROID)
#include <signal.h> // NOLINT
#if !defined(__BIONIC_HAVE_UCONTEXT_T)
#include <asm/sigcontext.h> // NOLINT
@@ -25,15 +25,15 @@
uint32_t uc_sigmask;
} ucontext_t;
#endif // !defined(__BIONIC_HAVE_UCONTEXT_T)
-#elif defined(HOST_OS_MACOS)
+#elif defined(DART_HOST_OS_MACOS)
#include <signal.h> // NOLINT
#include <sys/ucontext.h> // NOLINT
-#elif defined(HOST_OS_WINDOWS)
+#elif defined(DART_HOST_OS_WINDOWS)
// Stub out for windows.
struct siginfo_t;
struct mcontext_t;
struct sigset_t {};
-#elif defined(HOST_OS_FUCHSIA)
+#elif defined(DART_HOST_OS_FUCHSIA)
#include <signal.h> // NOLINT
#include <ucontext.h> // NOLINT
#endif
@@ -42,7 +42,7 @@
// work around incorrect Thumb -> ARM transitions. See SignalHandlerTrampoline
// below for more details.
#if defined(HOST_ARCH_ARM) && \
- (defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID)) && \
+ (defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)) && \
!defined(__thumb__)
#define USE_SIGNAL_HANDLER_TRAMPOLINE
#endif
diff --git a/runtime/vm/signal_handler_android.cc b/runtime/vm/signal_handler_android.cc
index cdef00f..47c2ded 100644
--- a/runtime/vm/signal_handler_android.cc
+++ b/runtime/vm/signal_handler_android.cc
@@ -6,7 +6,7 @@
#include "vm/instructions.h"
#include "vm/signal_handler.h"
#include "vm/simulator.h"
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
namespace dart {
@@ -138,4 +138,4 @@
} // namespace dart
-#endif // defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_ANDROID)
diff --git a/runtime/vm/signal_handler_fuchsia.cc b/runtime/vm/signal_handler_fuchsia.cc
index a0f0cf1..3a2f161 100644
--- a/runtime/vm/signal_handler_fuchsia.cc
+++ b/runtime/vm/signal_handler_fuchsia.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h"
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
#include "vm/signal_handler.h"
@@ -46,4 +46,4 @@
} // namespace dart
-#endif // defined(HOST_OS_FUCHSIA)
+#endif // defined(DART_HOST_OS_FUCHSIA)
diff --git a/runtime/vm/signal_handler_linux.cc b/runtime/vm/signal_handler_linux.cc
index a9cb30b..ae75730 100644
--- a/runtime/vm/signal_handler_linux.cc
+++ b/runtime/vm/signal_handler_linux.cc
@@ -6,7 +6,7 @@
#include "vm/instructions.h"
#include "vm/signal_handler.h"
#include "vm/simulator.h"
-#if defined(HOST_OS_LINUX)
+#if defined(DART_HOST_OS_LINUX)
namespace dart {
@@ -117,4 +117,4 @@
} // namespace dart
-#endif // defined(HOST_OS_LINUX)
+#endif // defined(DART_HOST_OS_LINUX)
diff --git a/runtime/vm/signal_handler_macos.cc b/runtime/vm/signal_handler_macos.cc
index 081a947..71ad84f 100644
--- a/runtime/vm/signal_handler_macos.cc
+++ b/runtime/vm/signal_handler_macos.cc
@@ -6,7 +6,7 @@
#include "vm/instructions.h"
#include "vm/signal_handler.h"
#include "vm/simulator.h"
-#if defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_MACOS)
namespace dart {
@@ -113,4 +113,4 @@
} // namespace dart
-#endif // defined(HOST_OS_MACOS)
+#endif // defined(DART_HOST_OS_MACOS)
diff --git a/runtime/vm/signal_handler_win.cc b/runtime/vm/signal_handler_win.cc
index f38ba71..254164c 100644
--- a/runtime/vm/signal_handler_win.cc
+++ b/runtime/vm/signal_handler_win.cc
@@ -4,7 +4,7 @@
#include "vm/globals.h"
#include "vm/signal_handler.h"
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
namespace dart {
@@ -43,4 +43,4 @@
} // namespace dart
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
diff --git a/runtime/vm/simulator_arm.cc b/runtime/vm/simulator_arm.cc
index a775233..d17cb92 100644
--- a/runtime/vm/simulator_arm.cc
+++ b/runtime/vm/simulator_arm.cc
@@ -3554,7 +3554,7 @@
int32_t r6_val = get_register(R6);
int32_t r7_val = get_register(R7);
int32_t r8_val = get_register(R8);
-#if !defined(TARGET_OS_MACOS) && !defined(TARGET_OS_MACOS_IOS)
+#if !defined(DART_TARGET_OS_MACOS) && !defined(DART_TARGET_OS_MACOS_IOS)
int32_t r9_val = get_register(R9);
#endif
int32_t r10_val = get_register(R10);
@@ -3588,7 +3588,7 @@
set_register(R6, callee_saved_value);
set_register(R7, callee_saved_value);
set_register(R8, callee_saved_value);
-#if !defined(TARGET_OS_MACOS) && !defined(TARGET_OS_MACOS_IOS)
+#if !defined(DART_TARGET_OS_MACOS) && !defined(DART_TARGET_OS_MACOS_IOS)
set_register(R9, callee_saved_value);
#endif
set_register(R10, callee_saved_value);
@@ -3616,7 +3616,7 @@
ASSERT(callee_saved_value == get_register(R6));
ASSERT(callee_saved_value == get_register(R7));
ASSERT(callee_saved_value == get_register(R8));
-#if !defined(TARGET_OS_MACOS) && !defined(TARGET_OS_MACOS_IOS)
+#if !defined(DART_TARGET_OS_MACOS) && !defined(DART_TARGET_OS_MACOS_IOS)
ASSERT(callee_saved_value == get_register(R9));
#endif
ASSERT(callee_saved_value == get_register(R10));
@@ -3639,7 +3639,7 @@
set_register(R6, r6_val);
set_register(R7, r7_val);
set_register(R8, r8_val);
-#if !defined(TARGET_OS_MACOS) && !defined(TARGET_OS_MACOS_IOS)
+#if !defined(DART_TARGET_OS_MACOS) && !defined(DART_TARGET_OS_MACOS_IOS)
set_register(R9, r9_val);
#endif
set_register(R10, r10_val);
diff --git a/runtime/vm/simulator_arm64.cc b/runtime/vm/simulator_arm64.cc
index 83f65d7..f62ce3bf 100644
--- a/runtime/vm/simulator_arm64.cc
+++ b/runtime/vm/simulator_arm64.cc
@@ -950,7 +950,7 @@
R31Type r31t) {
// Register is in range.
ASSERT((reg >= 0) && (reg < kNumberOfCpuRegisters));
-#if !defined(TARGET_OS_FUCHSIA)
+#if !defined(DART_TARGET_OS_FUCHSIA)
ASSERT(instr == NULL || reg != R18); // R18 is globally reserved on iOS.
#endif
@@ -2711,7 +2711,7 @@
// Format(instr, "smulh 'rd, 'rn, 'rm");
const int64_t rn_val = get_register(rn, R31IsZR);
const int64_t rm_val = get_register(rm, R31IsZR);
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
// Visual Studio does not support __int128.
int64_t alu_out;
Multiply128(rn_val, rm_val, &alu_out);
@@ -2719,7 +2719,7 @@
const __int128 res =
static_cast<__int128>(rn_val) * static_cast<__int128>(rm_val);
const int64_t alu_out = static_cast<int64_t>(res >> 64);
-#endif // HOST_OS_WINDOWS
+#endif // DART_HOST_OS_WINDOWS
set_register(instr, rd, alu_out, R31IsZR);
} else if ((instr->Bits(29, 3) == 4) && (instr->Bits(21, 3) == 6) &&
(instr->Bit(15) == 0)) {
@@ -2727,7 +2727,7 @@
// Format(instr, "umulh 'rd, 'rn, 'rm");
const uint64_t rn_val = get_register(rn, R31IsZR);
const uint64_t rm_val = get_register(rm, R31IsZR);
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
// Visual Studio does not support __int128.
uint64_t alu_out;
UnsignedMultiply128(rn_val, rm_val, &alu_out);
@@ -2735,7 +2735,7 @@
const unsigned __int128 res = static_cast<unsigned __int128>(rn_val) *
static_cast<unsigned __int128>(rm_val);
const uint64_t alu_out = static_cast<uint64_t>(res >> 64);
-#endif // HOST_OS_WINDOWS
+#endif // DART_HOST_OS_WINDOWS
set_register(instr, rd, alu_out, R31IsZR);
} else if ((instr->Bits(29, 3) == 4) && (instr->Bit(15) == 0)) {
if (instr->Bits(21, 3) == 5) {
diff --git a/runtime/vm/stack_frame.cc b/runtime/vm/stack_frame.cc
index b083155..e9fc6f7 100644
--- a/runtime/vm/stack_frame.cc
+++ b/runtime/vm/stack_frame.cc
@@ -146,7 +146,7 @@
}
ASSERT(!(IsEntryFrame() || IsExitFrame()));
-#if !defined(HOST_OS_WINDOWS) && !defined(HOST_OS_FUCHSIA)
+#if !defined(DART_HOST_OS_WINDOWS) && !defined(DART_HOST_OS_FUCHSIA)
// On Windows and Fuchsia, the profiler calls this from a separate thread
// where Thread::Current() is NULL, so we cannot create a NoSafepointScope.
NoSafepointScope no_safepoint;
@@ -335,7 +335,7 @@
// We add a no gc scope to ensure that the code below does not trigger
// a GC as we are handling raw object references here. It is possible
// that the code is called while a GC is in progress, that is ok.
-#if !defined(HOST_OS_WINDOWS) && !defined(HOST_OS_FUCHSIA)
+#if !defined(DART_HOST_OS_WINDOWS) && !defined(DART_HOST_OS_FUCHSIA)
// On Windows and Fuchsia, the profiler calls this from a separate thread
// where Thread::Current() is NULL, so we cannot create a NoSafepointScope.
NoSafepointScope no_safepoint;
diff --git a/runtime/vm/stack_frame_arm.h b/runtime/vm/stack_frame_arm.h
index e79cc9c..8b5a5d3 100644
--- a/runtime/vm/stack_frame_arm.h
+++ b/runtime/vm/stack_frame_arm.h
@@ -49,7 +49,7 @@
static const int kLastParamSlotFromEntrySp = 0;
// Entry and exit frame layout.
-#if defined(TARGET_OS_MACOS) || defined(TARGET_OS_MACOS_IOS)
+#if defined(DART_TARGET_OS_MACOS) || defined(DART_TARGET_OS_MACOS_IOS)
static const int kExitLinkSlotFromEntryFp = -27;
COMPILE_ASSERT(kAbiPreservedCpuRegCount == 6);
COMPILE_ASSERT(kAbiPreservedFpuRegCount == 4);
diff --git a/runtime/vm/stack_frame_arm64.h b/runtime/vm/stack_frame_arm64.h
index a487e67..a6d1e9d 100644
--- a/runtime/vm/stack_frame_arm64.h
+++ b/runtime/vm/stack_frame_arm64.h
@@ -49,7 +49,7 @@
static const int kLastParamSlotFromEntrySp = 0;
// Entry and exit frame layout.
-#if defined(TARGET_OS_FUCHSIA)
+#if defined(DART_TARGET_OS_FUCHSIA)
static const int kExitLinkSlotFromEntryFp = -24;
COMPILE_ASSERT(kAbiPreservedCpuRegCount == 11);
#else
diff --git a/runtime/vm/stack_frame_x64.h b/runtime/vm/stack_frame_x64.h
index fd6176b..d924db1 100644
--- a/runtime/vm/stack_frame_x64.h
+++ b/runtime/vm/stack_frame_x64.h
@@ -52,11 +52,11 @@
static const int kLastParamSlotFromEntrySp = 1; // Skip return address.
// Entry and exit frame layout.
-#if defined(TARGET_OS_WINDOWS)
+#if defined(DART_TARGET_OS_WINDOWS)
static const int kExitLinkSlotFromEntryFp = -33;
#else
static const int kExitLinkSlotFromEntryFp = -11;
-#endif // defined(TARGET_OS_WINDOWS)
+#endif // defined(DART_TARGET_OS_WINDOWS)
// For FFI native -> Dart callbacks, the number of stack slots between arguments
// passed on stack and arguments saved in callback prologue. 2 = return adddress
diff --git a/runtime/vm/tagged_pointer.h b/runtime/vm/tagged_pointer.h
index cbf9a35..dac584b 100644
--- a/runtime/vm/tagged_pointer.h
+++ b/runtime/vm/tagged_pointer.h
@@ -194,7 +194,7 @@
uword heap_base() const {
// TODO(rmacnak): Why does Windows have trouble linking GetClassId used
// here?
-#if !defined(HOST_OS_WINDOWS)
+#if !defined(DART_HOST_OS_WINDOWS)
ASSERT(IsHeapObject());
ASSERT(!IsInstructions());
ASSERT(!IsInstructionsSection());
diff --git a/runtime/vm/thread.h b/runtime/vm/thread.h
index 0f74638..2d80830 100644
--- a/runtime/vm/thread.h
+++ b/runtime/vm/thread.h
@@ -1261,7 +1261,7 @@
}
};
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
// Clears the state of the current thread and frees the allocation.
void WindowsThreadCleanUp();
#endif
diff --git a/runtime/vm/thread_interrupter_android.cc b/runtime/vm/thread_interrupter_android.cc
index 87eb5fc..367fa41 100644
--- a/runtime/vm/thread_interrupter_android.cc
+++ b/runtime/vm/thread_interrupter_android.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_ANDROID)
#include <errno.h> // NOLINT
#include <sys/syscall.h> // NOLINT
@@ -75,4 +75,4 @@
} // namespace dart
-#endif // defined(HOST_OS_ANDROID)
+#endif // defined(DART_HOST_OS_ANDROID)
diff --git a/runtime/vm/thread_interrupter_fuchsia.cc b/runtime/vm/thread_interrupter_fuchsia.cc
index c0f5d5e..b295569 100644
--- a/runtime/vm/thread_interrupter_fuchsia.cc
+++ b/runtime/vm/thread_interrupter_fuchsia.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
#include "vm/thread_interrupter.h"
@@ -255,4 +255,4 @@
} // namespace dart
-#endif // defined(HOST_OS_FUCHSIA)
+#endif // defined(DART_HOST_OS_FUCHSIA)
diff --git a/runtime/vm/thread_interrupter_linux.cc b/runtime/vm/thread_interrupter_linux.cc
index 04b0686..300a3dd 100644
--- a/runtime/vm/thread_interrupter_linux.cc
+++ b/runtime/vm/thread_interrupter_linux.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_LINUX)
+#if defined(DART_HOST_OS_LINUX)
#include <errno.h> // NOLINT
@@ -74,4 +74,4 @@
} // namespace dart
-#endif // defined(HOST_OS_LINUX)
+#endif // defined(DART_HOST_OS_LINUX)
diff --git a/runtime/vm/thread_interrupter_macos.cc b/runtime/vm/thread_interrupter_macos.cc
index eb89fe7..bc81f93 100644
--- a/runtime/vm/thread_interrupter_macos.cc
+++ b/runtime/vm/thread_interrupter_macos.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_MACOS)
#include <assert.h> // NOLINT
#include <errno.h> // NOLINT
@@ -95,4 +95,4 @@
} // namespace dart
-#endif // defined(HOST_OS_MACOS)
+#endif // defined(DART_HOST_OS_MACOS)
diff --git a/runtime/vm/thread_interrupter_win.cc b/runtime/vm/thread_interrupter_win.cc
index c862a22..bfbf5d1 100644
--- a/runtime/vm/thread_interrupter_win.cc
+++ b/runtime/vm/thread_interrupter_win.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#include "vm/flags.h"
#include "vm/os.h"
@@ -118,4 +118,4 @@
} // namespace dart
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
diff --git a/runtime/vm/timeline.cc b/runtime/vm/timeline.cc
index 74d2ef4..e57fa3b 100644
--- a/runtime/vm/timeline.cc
+++ b/runtime/vm/timeline.cc
@@ -106,13 +106,13 @@
THR_Print("Using the Systrace timeline recorder.\n");
}
-#if defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)
return new TimelineEventSystraceRecorder();
-#elif defined(HOST_OS_MACOS)
+#elif defined(DART_HOST_OS_MACOS)
if (__builtin_available(iOS 12.0, macOS 10.14, *)) {
return new TimelineEventMacosRecorder();
}
-#elif defined(HOST_OS_FUCHSIA)
+#elif defined(DART_HOST_OS_FUCHSIA)
return new TimelineEventFuchsiaRecorder();
#else
OS::PrintErr(
@@ -754,13 +754,13 @@
bool enabled)
: name_(name),
fuchsia_name_(fuchsia_name),
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
enabled_(static_cast<uintptr_t>(true)) // For generated code.
#else
enabled_(static_cast<uintptr_t>(enabled))
#endif
{
-#if defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_MACOS)
if (__builtin_available(iOS 12.0, macOS 10.14, *)) {
macos_log_ = os_log_create("Dart", name);
}
@@ -1086,7 +1086,7 @@
int64_t TimelineEventRecorder::GetNextAsyncId() {
// TODO(johnmccutchan): Gracefully handle wrap around.
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
return trace_generate_nonce();
#else
uint32_t next = static_cast<uint32_t>(async_id_.fetch_add(1u));
diff --git a/runtime/vm/timeline.h b/runtime/vm/timeline.h
index ce3def9..69302aa 100644
--- a/runtime/vm/timeline.h
+++ b/runtime/vm/timeline.h
@@ -15,16 +15,16 @@
#include "vm/os.h"
#include "vm/os_thread.h"
-#if defined(FUCHSIA_SDK) || defined (HOST_OS_FUCHSIA)
+#if defined(FUCHSIA_SDK) || defined(DART_HOST_OS_FUCHSIA)
#include <lib/trace-engine/context.h>
#include <lib/trace-engine/instrumentation.h>
-#elif defined(HOST_OS_MACOS)
+#elif defined(DART_HOST_OS_MACOS)
#include <os/availability.h>
#if defined(__MAC_10_14) || defined (__IPHONE_12_0)
-#define HOST_OS_SUPPORTS_SIGNPOST 1
+#define DART_HOST_OS_SUPPORTS_SIGNPOST 1
#endif
// signpost.h exists in macOS 10.14, iOS 12 or above
-#if defined(HOST_OS_SUPPORTS_SIGNPOST)
+#if defined(DART_HOST_OS_SUPPORTS_SIGNPOST)
#include <os/signpost.h>
#else
#include <os/log.h>
@@ -77,7 +77,7 @@
const char* fuchsia_name() const { return fuchsia_name_; }
bool enabled() {
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
#ifdef PRODUCT
return trace_is_category_enabled(fuchsia_name_);
#else
@@ -85,7 +85,7 @@
#endif // PRODUCT
#else
return enabled_ != 0;
-#endif // defined(HOST_OS_FUCHSIA)
+#endif // defined(DART_HOST_OS_FUCHSIA)
}
void set_enabled(bool enabled) { enabled_ = enabled ? 1 : 0; }
@@ -100,9 +100,9 @@
return OFFSET_OF(TimelineStream, enabled_);
}
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
trace_site_t* trace_site() { return &trace_site_; }
-#elif defined(HOST_OS_MACOS)
+#elif defined(DART_HOST_OS_MACOS)
os_log_t macos_log() { return macos_log_; }
#endif
@@ -114,9 +114,9 @@
// 0 or 1. If this becomes a BitField, the generated code must be updated.
uintptr_t enabled_;
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
trace_site_t trace_site_ = {};
-#elif defined(HOST_OS_MACOS)
+#elif defined(DART_HOST_OS_MACOS)
os_log_t macos_log_ = {};
#endif
};
@@ -933,7 +933,7 @@
void CompleteEvent(TimelineEvent* event);
};
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
// A recorder that sends events to Fuchsia's tracing app.
class TimelineEventFuchsiaRecorder : public TimelineEventPlatformRecorder {
public:
@@ -946,9 +946,9 @@
private:
void OnEvent(TimelineEvent* event);
};
-#endif // defined(HOST_OS_FUCHSIA)
+#endif // defined(DART_HOST_OS_FUCHSIA)
-#if defined(HOST_OS_ANDROID) || defined(HOST_OS_LINUX)
+#if defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_LINUX)
// A recorder that writes events to Android Systrace. This class is exposed in
// this header file only so that PrintSystrace can be visible to
// timeline_test.cc.
@@ -969,9 +969,9 @@
int systrace_fd_;
};
-#endif // defined(HOST_OS_ANDROID) || defined(HOST_OS_LINUX)
+#endif // defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_LINUX)
-#if defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_MACOS)
// A recorder that sends events to Macos's tracing app. See:
// https://developer.apple.com/documentation/os/logging?language=objc
class TimelineEventMacosRecorder : public TimelineEventPlatformRecorder {
@@ -985,7 +985,7 @@
private:
void OnEvent(TimelineEvent* event) API_AVAILABLE(ios(12.0), macos(10.14));
};
-#endif // defined(HOST_OS_MACOS)
+#endif // defined(DART_HOST_OS_MACOS)
class DartTimelineEventHelpers : public AllStatic {
public:
diff --git a/runtime/vm/timeline_android.cc b/runtime/vm/timeline_android.cc
index 046d0a2..93e2faa 100644
--- a/runtime/vm/timeline_android.cc
+++ b/runtime/vm/timeline_android.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h"
-#if defined(HOST_OS_ANDROID) && defined(SUPPORT_TIMELINE)
+#if defined(DART_HOST_OS_ANDROID) && defined(SUPPORT_TIMELINE)
#include <errno.h>
#include <fcntl.h>
@@ -115,4 +115,4 @@
} // namespace dart
-#endif // defined(HOST_OS_ANDROID) && !defined(PRODUCT)
+#endif // defined(DART_HOST_OS_ANDROID) && !defined(PRODUCT)
diff --git a/runtime/vm/timeline_fuchsia.cc b/runtime/vm/timeline_fuchsia.cc
index 5d119fc..38bca29 100644
--- a/runtime/vm/timeline_fuchsia.cc
+++ b/runtime/vm/timeline_fuchsia.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h"
-#if defined(HOST_OS_FUCHSIA) && defined(SUPPORT_TIMELINE)
+#if defined(DART_HOST_OS_FUCHSIA) && defined(SUPPORT_TIMELINE)
#include <lib/trace-engine/context.h>
#include <lib/trace-engine/instrumentation.h>
#include <zircon/syscalls.h>
@@ -121,4 +121,4 @@
} // namespace dart
-#endif // defined(HOST_OS_FUCHSIA) && defined(SUPPORT_TIMELINE)
+#endif // defined(DART_HOST_OS_FUCHSIA) && defined(SUPPORT_TIMELINE)
diff --git a/runtime/vm/timeline_linux.cc b/runtime/vm/timeline_linux.cc
index 3756f16..f685df2 100644
--- a/runtime/vm/timeline_linux.cc
+++ b/runtime/vm/timeline_linux.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h"
-#if defined(HOST_OS_LINUX) && defined(SUPPORT_TIMELINE)
+#if defined(DART_HOST_OS_LINUX) && defined(SUPPORT_TIMELINE)
#include <errno.h>
#include <fcntl.h>
@@ -115,4 +115,4 @@
} // namespace dart
-#endif // defined(HOST_OS_LINUX) && !defined(PRODUCT)
+#endif // defined(DART_HOST_OS_LINUX) && !defined(PRODUCT)
diff --git a/runtime/vm/timeline_macos.cc b/runtime/vm/timeline_macos.cc
index 93e0f7d..1bda7e5 100644
--- a/runtime/vm/timeline_macos.cc
+++ b/runtime/vm/timeline_macos.cc
@@ -3,8 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h"
-#if defined(HOST_OS_MACOS) && defined(SUPPORT_TIMELINE)
-
+#if defined(DART_HOST_OS_MACOS) && defined(SUPPORT_TIMELINE)
#include "vm/log.h"
#include "vm/timeline.h"
@@ -22,7 +21,7 @@
return;
}
-#if defined(HOST_OS_SUPPORTS_SIGNPOST)
+#if defined(DART_HOST_OS_SUPPORTS_SIGNPOST)
os_log_t log = event->stream_->macos_log();
if (!os_signpost_enabled(log)) {
return;
@@ -75,9 +74,9 @@
default:
break;
}
-#endif // defined(HOST_OS_SUPPORTS_SIGNPOST)
+#endif // defined(DART_HOST_OS_SUPPORTS_SIGNPOST)
}
} // namespace dart
-#endif // defined(HOST_OS_MACOS) && defined(SUPPORT_TIMELINE)
+#endif // defined(DART_HOST_OS_MACOS) && defined(SUPPORT_TIMELINE)
diff --git a/runtime/vm/timeline_test.cc b/runtime/vm/timeline_test.cc
index f171921..97699cd 100644
--- a/runtime/vm/timeline_test.cc
+++ b/runtime/vm/timeline_test.cc
@@ -163,7 +163,7 @@
event.DurationEnd();
}
-#if defined(HOST_OS_ANDROID) || defined(HOST_OS_LINUX)
+#if defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_LINUX)
TEST_CASE(TimelineEventPrintSystrace) {
const intptr_t kBufferLength = 1024;
char buffer[kBufferLength];
@@ -209,7 +209,7 @@
kBufferLength);
EXPECT_STREQ("", buffer);
}
-#endif // defined(HOST_OS_ANDROID) || defined(HOST_OS_LINUX)
+#endif // defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_LINUX)
TEST_CASE(TimelineEventArguments) {
// Create a test stream.
diff --git a/runtime/vm/virtual_memory_compressed.h b/runtime/vm/virtual_memory_compressed.h
index 4201018..0df8b1c 100644
--- a/runtime/vm/virtual_memory_compressed.h
+++ b/runtime/vm/virtual_memory_compressed.h
@@ -20,9 +20,9 @@
static constexpr intptr_t kCompressedHeapBitmapSize =
kCompressedHeapNumPages / 8;
-#if !defined(HOST_OS_FUCHSIA)
+#if !defined(DART_HOST_OS_FUCHSIA)
#define DART_COMPRESSED_HEAP
-#endif // !defined(HOST_OS_FUCHSIA)
+#endif // !defined(DART_HOST_OS_FUCHSIA)
#endif // defined(DART_COMPRESSED_POINTERS)
#if defined(DART_COMPRESSED_HEAP)
diff --git a/runtime/vm/virtual_memory_fuchsia.cc b/runtime/vm/virtual_memory_fuchsia.cc
index 731b86d..7f7347d 100644
--- a/runtime/vm/virtual_memory_fuchsia.cc
+++ b/runtime/vm/virtual_memory_fuchsia.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h"
-#if defined(HOST_OS_FUCHSIA)
+#if defined(DART_HOST_OS_FUCHSIA)
#include "vm/virtual_memory.h"
@@ -279,4 +279,4 @@
} // namespace dart
-#endif // defined(HOST_OS_FUCHSIA)
+#endif // defined(DART_HOST_OS_FUCHSIA)
diff --git a/runtime/vm/virtual_memory_posix.cc b/runtime/vm/virtual_memory_posix.cc
index aeb4a52..2d8757da 100644
--- a/runtime/vm/virtual_memory_posix.cc
+++ b/runtime/vm/virtual_memory_posix.cc
@@ -3,7 +3,8 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h"
-#if defined(HOST_OS_ANDROID) || defined(HOST_OS_LINUX) || defined(HOST_OS_MACOS)
+#if defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_LINUX) || \
+ defined(DART_HOST_OS_MACOS)
#include "vm/virtual_memory.h"
@@ -37,7 +38,7 @@
DECLARE_FLAG(bool, dual_map_code);
DECLARE_FLAG(bool, write_protect_code);
-#if defined(TARGET_OS_LINUX)
+#if defined(DART_TARGET_OS_LINUX)
DECLARE_FLAG(bool, generate_perf_events_symbols);
DECLARE_FLAG(bool, generate_perf_jitdump);
#endif
@@ -101,7 +102,7 @@
#if defined(DUAL_MAPPING_SUPPORTED)
// Perf is Linux-specific and the flags aren't defined in Product.
-#if defined(TARGET_OS_LINUX) && !defined(PRODUCT)
+#if defined(DART_TARGET_OS_LINUX) && !defined(PRODUCT)
// Perf interacts strangely with memfds, leading it to sometimes collect
// garbled return addresses.
if (FLAG_generate_perf_events_symbols || FLAG_generate_perf_jitdump) {
@@ -136,7 +137,7 @@
}
#endif // defined(DUAL_MAPPING_SUPPORTED)
-#if defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID)
+#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)
FILE* fp = fopen("/proc/sys/vm/max_map_count", "r");
if (fp != nullptr) {
size_t max_map_count = 0;
@@ -286,7 +287,7 @@
// The mapping will be RX and stays that way until it will eventually be
// unmapped.
MemoryRegion region(region_ptr, size);
- // DUAL_MAPPING_SUPPORTED is false in TARGET_OS_MACOS and hence support
+ // DUAL_MAPPING_SUPPORTED is false in DART_TARGET_OS_MACOS and hence support
// for MAP_JIT is not required here.
const int alias_prot = PROT_READ | PROT_EXEC;
void* hint = reinterpret_cast<void*>(&Dart_Initialize);
@@ -333,11 +334,11 @@
#endif
int map_flags = MAP_PRIVATE | MAP_ANONYMOUS;
-#if (defined(HOST_OS_MACOS) && !defined(HOST_OS_IOS))
+#if (defined(DART_HOST_OS_MACOS) && !defined(DART_HOST_OS_IOS))
if (is_executable && IsAtLeastOS10_14()) {
map_flags |= MAP_JIT;
}
-#endif // defined(HOST_OS_MACOS)
+#endif // defined(DART_HOST_OS_MACOS)
void* hint = nullptr;
// Some 64-bit microarchitectures store only the low 32-bits of targets as
@@ -431,4 +432,5 @@
} // namespace dart
-#endif // defined(HOST_OS_ANDROID ... HOST_OS_LINUX ... HOST_OS_MACOS)
+#endif // defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_LINUX) || \
+ // defined(DART_HOST_OS_MACOS)
diff --git a/runtime/vm/virtual_memory_win.cc b/runtime/vm/virtual_memory_win.cc
index 994833d..5348b3c 100644
--- a/runtime/vm/virtual_memory_win.cc
+++ b/runtime/vm/virtual_memory_win.cc
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h"
-#if defined(HOST_OS_WINDOWS)
+#if defined(DART_HOST_OS_WINDOWS)
#include "vm/virtual_memory.h"
@@ -191,4 +191,4 @@
} // namespace dart
-#endif // defined(HOST_OS_WINDOWS)
+#endif // defined(DART_HOST_OS_WINDOWS)
diff --git a/tools/VERSION b/tools/VERSION
index 7d1712c..f2fc2a46 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 14
PATCH 0
-PRERELEASE 272
+PRERELEASE 273
PRERELEASE_PATCH 0
\ No newline at end of file