-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Copy pathcode_comments.h
35 lines (27 loc) · 1.01 KB
/
code_comments.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright (c) 2019, 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.
#ifndef RUNTIME_VM_CODE_COMMENTS_H_
#define RUNTIME_VM_CODE_COMMENTS_H_
#include "vm/globals.h" // For INCLUDE_IL_PRINTER
#if defined(INCLUDE_IL_PRINTER)
namespace dart {
// An abstract representation of comments associated with the given code
// object. We assume that comments are sorted by PCOffset.
class CodeComments {
public:
CodeComments() = default;
virtual ~CodeComments() = default;
virtual intptr_t Length() const = 0;
virtual intptr_t PCOffsetAt(intptr_t index) const = 0;
virtual const char* CommentAt(intptr_t index) const = 0;
};
#if !defined(DART_PRECOMPILED_RUNTIME)
namespace compiler {
class Assembler;
}
const CodeComments& CreateCommentsFrom(compiler::Assembler* assembler);
#endif
} // namespace dart
#endif // defined(INCLUDE_IL_PRINTER)
#endif // RUNTIME_VM_CODE_COMMENTS_H_