Commit 4d4fe18d authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

Revert "[torque] Introduce force_assert_statements compiler option"

This reverts commit 2d45ecf0.

Reason for revert: Fails on arm64 msan: https://ci.chromium.org/p/v8/builders/ci/V8%20Linux%20-%20arm64%20-%20sim%20-%20MSAN/26567

Original change's description:
> [torque] Introduce force_assert_statements compiler option
> 
> "assert(...)" statements are usually only visited and generated in
> debug builds. To provide Language Server support for statements inside
> asserts, the force_assert_statements option allows to manually
> override this behavior and visit assert statements in release builds.
> 
> R=​sigurds@chromium.org
> 
> Bug: v8:7793
> Change-Id: I38f48e35f2b0a1a98abb74b7babb1edd2d7dba24
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1599180
> Auto-Submit: Simon Zünd <szuend@chromium.org>
> Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
> Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#61295}

TBR=sigurds@chromium.org,szuend@chromium.org

Change-Id: Ib0f72a756ff1f6c9838d3d7f837a326b1dab3278
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7793
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1599549Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61296}
parent 2d45ecf0
......@@ -20,7 +20,6 @@ class GlobalContext : public ContextualClass<GlobalContext> {
explicit GlobalContext(Ast ast)
: verbose_(false),
collect_language_server_data_(false),
force_assert_statements_(false),
ast_(std::move(ast)) {
CurrentScope::Scope current_scope(nullptr);
CurrentSourcePosition::Scope current_source_position(
......@@ -73,18 +72,11 @@ class GlobalContext : public ContextualClass<GlobalContext> {
static bool collect_language_server_data() {
return Get().collect_language_server_data_;
}
static void SetForceAssertStatements() {
Get().force_assert_statements_ = true;
}
static bool force_assert_statements() {
return Get().force_assert_statements_;
}
static Ast* ast() { return &Get().ast_; }
private:
bool verbose_;
bool collect_language_server_data_;
bool force_assert_statements_;
Namespace* default_namespace_;
Ast ast_;
std::vector<std::unique_ptr<Declarable>> declarables_;
......
......@@ -1002,7 +1002,7 @@ std::string FormatAssertSource(const std::string& str) {
} // namespace
const Type* ImplementationVisitor::Visit(AssertStatement* stmt) {
bool do_check = !stmt->debug_only || GlobalContext::force_assert_statements();
bool do_check = !stmt->debug_only;
#if defined(DEBUG)
do_check = true;
#endif
......
......@@ -180,7 +180,6 @@ void RecompileTorque(MessageWriter writer) {
options.output_directory = "";
options.verbose = false;
options.collect_language_server_data = true;
options.force_assert_statements = true;
TorqueCompilerResult result = CompileTorque(TorqueFileList::Get(), options);
......
......@@ -51,9 +51,6 @@ void CompileCurrentAst(TorqueCompilerOptions options) {
if (options.collect_language_server_data) {
GlobalContext::SetCollectLanguageServerData();
}
if (options.force_assert_statements) {
GlobalContext::SetForceAssertStatements();
}
TypeOracle::Scope type_oracle;
// Two-step process of predeclaration + resolution allows to resolve type
......
......@@ -19,11 +19,6 @@ struct TorqueCompilerOptions {
std::string output_directory;
bool verbose;
bool collect_language_server_data;
// assert(...) are only generated for debug builds. The provide
// language server support for statements inside asserts, this flag
// can force generate them.
bool force_assert_statements;
};
struct TorqueCompilerResult {
......
......@@ -33,7 +33,6 @@ int WrappedMain(int argc, const char** argv) {
options.output_directory = output_directory;
options.verbose = verbose;
options.collect_language_server_data = false;
options.force_assert_statements = false;
TorqueCompilerResult result = CompileTorque(files, options);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment