Flutter Engine
The Flutter Engine
code_comments.h
Go to the documentation of this file.
1// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5#ifndef RUNTIME_VM_CODE_COMMENTS_H_
6#define RUNTIME_VM_CODE_COMMENTS_H_
7
8#include "vm/globals.h" // For INCLUDE_IL_PRINTER
9#if defined(INCLUDE_IL_PRINTER)
10
11namespace dart {
12
13// An abstract representation of comments associated with the given code
14// object. We assume that comments are sorted by PCOffset.
15class CodeComments {
16 public:
17 CodeComments() = default;
18 virtual ~CodeComments() = default;
19
20 virtual intptr_t Length() const = 0;
21 virtual intptr_t PCOffsetAt(intptr_t index) const = 0;
22 virtual const char* CommentAt(intptr_t index) const = 0;
23};
24
25#if !defined(DART_PRECOMPILED_RUNTIME)
26namespace compiler {
27class Assembler;
28}
29const CodeComments& CreateCommentsFrom(compiler::Assembler* assembler);
30#endif
31
32} // namespace dart
33
34#endif // defined(INCLUDE_IL_PRINTER)
35#endif // RUNTIME_VM_CODE_COMMENTS_H_
Definition: dart_vm.cc:33