2019-08-21 13:33:37 +00:00
|
|
|
// 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_
|
|
|
|
|
2021-02-02 11:35:00 +00:00
|
|
|
#include "vm/globals.h" // For INCLUDE_IL_PRINTER
|
|
|
|
#if defined(INCLUDE_IL_PRINTER)
|
2019-08-21 13:33:37 +00:00
|
|
|
|
|
|
|
namespace dart {
|
|
|
|
|
2021-02-02 11:35:00 +00:00
|
|
|
// An abstract representation of comments associated with the given code
|
|
|
|
// object. We assume that comments are sorted by PCOffset.
|
|
|
|
class CodeComments {
|
2019-08-21 13:33:37 +00:00
|
|
|
public:
|
2021-02-02 11:35:00 +00:00
|
|
|
CodeComments() = default;
|
|
|
|
virtual ~CodeComments() = default;
|
2019-08-21 13:33:37 +00:00
|
|
|
|
2021-02-02 11:35:00 +00:00
|
|
|
virtual intptr_t Length() const = 0;
|
|
|
|
virtual intptr_t PCOffsetAt(intptr_t index) const = 0;
|
|
|
|
virtual const char* CommentAt(intptr_t index) const = 0;
|
2019-08-21 13:33:37 +00:00
|
|
|
};
|
|
|
|
|
2021-02-02 11:35:00 +00:00
|
|
|
#if !defined(DART_PRECOMPILED_RUNTIME)
|
|
|
|
namespace compiler {
|
|
|
|
class Assembler;
|
|
|
|
}
|
|
|
|
const CodeComments& CreateCommentsFrom(compiler::Assembler* assembler);
|
|
|
|
#endif
|
2019-08-21 13:33:37 +00:00
|
|
|
|
|
|
|
} // namespace dart
|
|
|
|
|
2021-02-02 11:35:00 +00:00
|
|
|
#endif // defined(INCLUDE_IL_PRINTER)
|
2019-08-21 13:33:37 +00:00
|
|
|
#endif // RUNTIME_VM_CODE_COMMENTS_H_
|