a41a1dc917
Make them form its own source set (libdart_compiler) and completely exclude them from AOT runtime targets. Previously we had some inconsistencies, with some files were using DART_PRECOMPILED_RUNTIME to fully or partially exclude either contents from their headers or from implementation, while other files did nothing and relied on linker to throw their contents away. This change tries to address this inconsistency. A follow up change would include a check in most compiler headers which would prohibit to use them while building AOT runtime. Change-Id: Ief11b11cbc518b301d3e93fce80580a31bbad151 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142993 Reviewed-by: Alexander Markov <alexmarkov@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com>
46 lines
1.4 KiB
C++
46 lines
1.4 KiB
C++
// 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_
|
|
|
|
#if !defined(DART_PRECOMPILED_RUNTIME) && \
|
|
(!defined(PRODUCT) || defined(FORCE_INCLUDE_DISASSEMBLER))
|
|
|
|
#include "vm/code_observers.h"
|
|
#include "vm/compiler/assembler/assembler.h"
|
|
#include "vm/object.h"
|
|
|
|
namespace dart {
|
|
|
|
class CodeCommentsWrapper final : public CodeComments {
|
|
public:
|
|
explicit CodeCommentsWrapper(const Code::Comments& comments)
|
|
: comments_(comments), string_(String::Handle()) {}
|
|
|
|
intptr_t Length() const override { return comments_.Length(); }
|
|
|
|
intptr_t PCOffsetAt(intptr_t i) const override {
|
|
return comments_.PCOffsetAt(i);
|
|
}
|
|
|
|
const char* CommentAt(intptr_t i) const override {
|
|
string_ = comments_.CommentAt(i);
|
|
return string_.ToCString();
|
|
}
|
|
|
|
private:
|
|
const Code::Comments& comments_;
|
|
String& string_;
|
|
};
|
|
|
|
const Code::Comments& CreateCommentsFrom(compiler::Assembler* assembler);
|
|
|
|
|
|
} // namespace dart
|
|
|
|
#endif // !defined(DART_PRECOMPILED_RUNTIME) && \
|
|
// (!defined(PRODUCT) || defined(FORCE_INCLUDE_DISASSEMBLER))
|
|
#endif // RUNTIME_VM_CODE_COMMENTS_H_
|