Commit f85481f8 authored by Hans Wennborg's avatar Hans Wennborg Committed by Commit Bot

[base] Stop including check.h, notreached.h, etc. in logging.h

The CHECK, CHECK_EQ etc., and NOTREACHED macros have moved out
of logging.h into separate, much cheaper to include, headers.

Now that the code has been updated to use the new headers, and
to not rergess on that, stop including them in logging.h.

Bug: 1031540
Change-Id: Idfa891b991cbca1dfef93630c0f37b1b022f99df
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2264413Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Auto-Submit: Hans Wennborg <hans@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#781970}
parent ffcf8351
...@@ -1616,7 +1616,7 @@ def _CheckNoDISABLETypoInTests(input_api, output_api): ...@@ -1616,7 +1616,7 @@ def _CheckNoDISABLETypoInTests(input_api, output_api):
def _CheckDCHECK_IS_ONHasBraces(input_api, output_api): def _CheckDCHECK_IS_ONHasBraces(input_api, output_api):
"""Checks to make sure DCHECK_IS_ON() does not skip the parentheses.""" """Checks to make sure DCHECK_IS_ON() does not skip the parentheses."""
errors = [] errors = []
pattern = input_api.re.compile(r'DCHECK_IS_ON(?!\(\))', pattern = input_api.re.compile(r'DCHECK_IS_ON\b(?!\(\))',
input_api.re.MULTILINE) input_api.re.MULTILINE)
for f in input_api.AffectedSourceFiles(input_api.FilterSourceFile): for f in input_api.AffectedSourceFiles(input_api.FilterSourceFile):
if (not f.LocalPath().endswith(('.cc', '.mm', '.h'))): if (not f.LocalPath().endswith(('.cc', '.mm', '.h'))):
......
...@@ -232,6 +232,7 @@ jumbo_component("base") { ...@@ -232,6 +232,7 @@ jumbo_component("base") {
"cpu.cc", "cpu.cc",
"cpu.h", "cpu.h",
"critical_closure.h", "critical_closure.h",
"dcheck_is_on.h",
"debug/activity_analyzer.cc", "debug/activity_analyzer.cc",
"debug/activity_analyzer.h", "debug/activity_analyzer.h",
"debug/activity_tracker.cc", "debug/activity_tracker.cc",
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "base/base_export.h" #include "base/base_export.h"
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/dcheck_is_on.h"
#include "base/immediate_crash.h" #include "base/immediate_crash.h"
// This header defines the CHECK, DCHECK, and DPCHECK macros. // This header defines the CHECK, DCHECK, and DPCHECK macros.
...@@ -126,12 +127,6 @@ class BASE_EXPORT CheckError { ...@@ -126,12 +127,6 @@ class BASE_EXPORT CheckError {
#endif #endif
#if defined(NDEBUG) && !defined(DCHECK_ALWAYS_ON)
#define DCHECK_IS_ON() false
#else
#define DCHECK_IS_ON() true
#endif
#if DCHECK_IS_ON() #if DCHECK_IS_ON()
#define DCHECK(condition) \ #define DCHECK(condition) \
......
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_DCHECK_IS_ON_H_
#define BASE_DCHECK_IS_ON_H_
#if defined(NDEBUG) && !defined(DCHECK_ALWAYS_ON)
#define DCHECK_IS_ON() false
#else
#define DCHECK_IS_ON() true
#endif
#endif // BASE_DCHECK_IS_ON_H_
...@@ -8,9 +8,13 @@ ...@@ -8,9 +8,13 @@
// build time. Try not to raise this limit unless absolutely necessary. See // build time. Try not to raise this limit unless absolutely necessary. See
// https://chromium.googlesource.com/chromium/src/+/HEAD/docs/wmax_tokens.md // https://chromium.googlesource.com/chromium/src/+/HEAD/docs/wmax_tokens.md
#ifndef NACL_TC_REV #ifndef NACL_TC_REV
#pragma clang max_tokens_here 370000 #pragma clang max_tokens_here 350000
#endif // NACL_TC_REV #endif // NACL_TC_REV
#ifdef BASE_CHECK_H_
#error "logging.h should not include check.h"
#endif
#include <limits.h> #include <limits.h>
#include <stdint.h> #include <stdint.h>
......
...@@ -14,11 +14,9 @@ ...@@ -14,11 +14,9 @@
#include "base/base_export.h" #include "base/base_export.h"
#include "base/callback_forward.h" #include "base/callback_forward.h"
#include "base/check.h"
#include "base/check_op.h"
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/dcheck_is_on.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/notreached.h"
#include "base/scoped_clear_last_error.h" #include "base/scoped_clear_last_error.h"
#include "base/strings/string_piece_forward.h" #include "base/strings/string_piece_forward.h"
......
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