Commit a86573a2 authored by David Bienvenu's avatar David Bienvenu Committed by Commit Bot

Update no-inlining for a clang-cl world

With VC++ marking a function as non-optimized with MSVC_DISABLE_OPTIMIZE would
prevent it from being inlined, however with clang-cl that does not work,
leading to confusing crash stacks.

The fix is to use NOINLINE instead of MSVC_DISABLE_OPTIMIZE, which is
more explicit and specific anyway.

Bug: 873359
Change-Id: I374c15af002c1864abac1d9a26f20026cc941a07
Reviewed-on: https://chromium-review.googlesource.com/1179961Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: David Bienvenu <davidbienvenu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584531}
parent bc34c035
......@@ -4,11 +4,6 @@
#include "chrome/browser/metrics/thread_watcher_report_hang.h"
// We disable optimizations for the whole file so the compiler doesn't merge
// them all together.
MSVC_DISABLE_OPTIMIZE()
MSVC_PUSH_DISABLE_WARNING(4748)
#include "base/debug/debugger.h"
#include "base/debug/dump_without_crashing.h"
......@@ -72,5 +67,3 @@ NOINLINE void CrashBecauseThreadWasUnresponsive(
} // namespace metrics
MSVC_POP_WARNING()
MSVC_ENABLE_OPTIMIZE();
......@@ -94,14 +94,12 @@ const GUID kChromeTraceProviderName = {
// Assertion handler for logging errors that occur when dialogs are
// silenced. To record a new error, pass the log string associated
// with that error in the str parameter.
MSVC_DISABLE_OPTIMIZE();
void SilentRuntimeAssertHandler(const char* file,
NOINLINE void SilentRuntimeAssertHandler(const char* file,
int line,
const base::StringPiece message,
const base::StringPiece stack_trace) {
base::debug::BreakDebugger();
}
MSVC_ENABLE_OPTIMIZE();
// Suppresses error/assertion dialogs and enables the logging of
// those errors into silenced_errors_.
......
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