Skip to content

Commit

Permalink
Revert "[build][torque] remove workarounds for clang bug"
Browse files Browse the repository at this point in the history
This reverts commit c5154ee.

Reason for revert: Broke ASAN bot

Original change's description:
> [build][torque] remove workarounds for clang bug
> 
> Now that https://bugs.llvm.org/show_bug.cgi?id=40118 has been fixed and
> rolled into V8, we can remove the workarounds for this Clang bug.
> 
> This also effectively reverts
> https://chromium-review.googlesource.com/c/v8/v8/+/1280222
> 
> Bug: chromium:893437
> Change-Id: Ia0d6d8ebdafafbc380b1b7a7809ef16effe50d71
> Reviewed-on: https://chromium-review.googlesource.com/c/1425519
> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
> Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58987}

TBR=jarin@chromium.org,tebbi@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: chromium:893437 chromium:924534
Change-Id: Idfc266c11e3413334a12694dd573bdecf5427890
Reviewed-on: https://chromium-review.googlesource.com/c/1430067
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59039}
  • Loading branch information
tebbi authored and Commit Bot committed Jan 23, 2019
1 parent ed37389 commit 42b50b7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
6 changes: 6 additions & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -3049,6 +3049,9 @@ v8_source_set("torque_base") {
]

configs = [ ":internal_config" ]
if (is_win && is_asan) {
remove_configs = [ "//build/config/sanitizers:default_sanitizer_flags" ]
}
}

v8_component("v8_libbase") {
Expand Down Expand Up @@ -3412,6 +3415,9 @@ if (current_toolchain == v8_snapshot_toolchain) {
]

configs = [ ":internal_config" ]
if (is_win && is_asan) {
remove_configs = [ "//build/config/sanitizers:default_sanitizer_flags" ]
}
}
}

Expand Down
22 changes: 16 additions & 6 deletions src/torque/instructions.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,10 @@ struct LoadObjectFieldInstruction : InstructionBase {
TORQUE_INSTRUCTION_BOILERPLATE()
LoadObjectFieldInstruction(const ClassType* class_type,
std::string field_name)
: class_type(class_type), field_name(std::move(field_name)) {}
: class_type(class_type) {
// The normal way to write this triggers a bug in Clang on Windows.
this->field_name = std::move(field_name);
}
const ClassType* class_type;
std::string field_name;
};
Expand All @@ -216,7 +219,10 @@ struct StoreObjectFieldInstruction : InstructionBase {
TORQUE_INSTRUCTION_BOILERPLATE()
StoreObjectFieldInstruction(const ClassType* class_type,
std::string field_name)
: class_type(class_type), field_name(std::move(field_name)) {}
: class_type(class_type) {
// The normal way to write this triggers a bug in Clang on Windows.
this->field_name = std::move(field_name);
}
const ClassType* class_type;
std::string field_name;
};
Expand Down Expand Up @@ -389,8 +395,10 @@ struct ReturnInstruction : InstructionBase {

struct PrintConstantStringInstruction : InstructionBase {
TORQUE_INSTRUCTION_BOILERPLATE()
explicit PrintConstantStringInstruction(std::string message)
: message(std::move(message)) {}
explicit PrintConstantStringInstruction(std::string message) {
// The normal way to write this triggers a bug in Clang on Windows.
this->message = std::move(message);
}

std::string message;
};
Expand All @@ -399,8 +407,10 @@ struct AbortInstruction : InstructionBase {
TORQUE_INSTRUCTION_BOILERPLATE()
enum class Kind { kDebugBreak, kUnreachable, kAssertionFailure };
bool IsBlockTerminator() const override { return kind != Kind::kDebugBreak; }
explicit AbortInstruction(Kind kind, std::string message = "")
: kind(kind), message(std::move(message)) {}
explicit AbortInstruction(Kind kind, std::string message = "") : kind(kind) {
// The normal way to write this triggers a bug in Clang on Windows.
this->message = std::move(message);
}

Kind kind;
std::string message;
Expand Down

0 comments on commit 42b50b7

Please sign in to comment.