Commit ede45574 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[debug][cleanup] Using 'using' instead of 'typedef'

Even though both are allowed in the style guide, it recommends to use
'using', as its syntax is more consistent with the rest of C++.
This CL turns all typedefs in src/debug to 'using' declarations.

R=jgruber@chromium.org

Bug: v8:8834
Change-Id: I205e14a0b230a26119e5b209a2bcec493a8815e3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1545901Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60698}
parent 2322b9a8
...@@ -21,7 +21,7 @@ class SharedToCounterMap ...@@ -21,7 +21,7 @@ class SharedToCounterMap
base::KeyEqualityMatcher<Object>, base::KeyEqualityMatcher<Object>,
base::DefaultAllocationPolicy> { base::DefaultAllocationPolicy> {
public: public:
typedef base::TemplateHashMapEntry<SharedFunctionInfo, uint32_t> Entry; using Entry = base::TemplateHashMapEntry<SharedFunctionInfo, uint32_t>;
inline void Add(SharedFunctionInfo key, uint32_t count) { inline void Add(SharedFunctionInfo key, uint32_t count) {
Entry* entry = LookupOrInsert(key, Hash(key), []() { return 0; }); Entry* entry = LookupOrInsert(key, Hash(key), []() { return 0; });
uint32_t old_count = entry->value; uint32_t old_count = entry->value;
......
...@@ -374,8 +374,8 @@ bool IntrinsicHasNoSideEffect(Runtime::FunctionId id) { ...@@ -374,8 +374,8 @@ bool IntrinsicHasNoSideEffect(Runtime::FunctionId id) {
} }
bool BytecodeHasNoSideEffect(interpreter::Bytecode bytecode) { bool BytecodeHasNoSideEffect(interpreter::Bytecode bytecode) {
typedef interpreter::Bytecode Bytecode; using interpreter::Bytecode;
typedef interpreter::Bytecodes Bytecodes; using interpreter::Bytecodes;
if (Bytecodes::IsWithoutExternalSideEffects(bytecode)) return true; if (Bytecodes::IsWithoutExternalSideEffects(bytecode)) return true;
if (Bytecodes::IsCallOrConstruct(bytecode)) return true; if (Bytecodes::IsCallOrConstruct(bytecode)) return true;
if (Bytecodes::IsJumpIfToBoolean(bytecode)) return true; if (Bytecodes::IsJumpIfToBoolean(bytecode)) return true;
...@@ -824,7 +824,7 @@ DebugInfo::SideEffectState BuiltinGetSideEffectState(Builtins::Name id) { ...@@ -824,7 +824,7 @@ DebugInfo::SideEffectState BuiltinGetSideEffectState(Builtins::Name id) {
} }
bool BytecodeRequiresRuntimeCheck(interpreter::Bytecode bytecode) { bool BytecodeRequiresRuntimeCheck(interpreter::Bytecode bytecode) {
typedef interpreter::Bytecode Bytecode; using interpreter::Bytecode;
switch (bytecode) { switch (bytecode) {
case Bytecode::kStaNamedProperty: case Bytecode::kStaNamedProperty:
case Bytecode::kStaNamedPropertyNoFeedback: case Bytecode::kStaNamedPropertyNoFeedback:
......
...@@ -128,8 +128,8 @@ class ScopeIterator { ...@@ -128,8 +128,8 @@ class ScopeIterator {
void UnwrapEvaluationContext(); void UnwrapEvaluationContext();
typedef std::function<bool(Handle<String> name, Handle<Object> value)> using Visitor =
Visitor; std::function<bool(Handle<String> name, Handle<Object> value)>;
Handle<JSObject> WithContextExtension(); Handle<JSObject> WithContextExtension();
......
...@@ -449,7 +449,7 @@ class V8_EXPORT_PRIVATE Debug { ...@@ -449,7 +449,7 @@ class V8_EXPORT_PRIVATE Debug {
void ClearAllDebuggerHints(); void ClearAllDebuggerHints();
// Wraps logic for clearing and maybe freeing all debug infos. // Wraps logic for clearing and maybe freeing all debug infos.
typedef std::function<void(Handle<DebugInfo>)> DebugInfoClearFunction; using DebugInfoClearFunction = std::function<void(Handle<DebugInfo>)>;
void ClearAllDebugInfos(const DebugInfoClearFunction& clear_function); void ClearAllDebugInfos(const DebugInfoClearFunction& clear_function);
void FindDebugInfo(Handle<DebugInfo> debug_info, DebugInfoListNode** prev, void FindDebugInfo(Handle<DebugInfo> debug_info, DebugInfoListNode** prev,
......
...@@ -194,7 +194,7 @@ class ConsoleDelegate { ...@@ -194,7 +194,7 @@ class ConsoleDelegate {
virtual ~ConsoleDelegate() = default; virtual ~ConsoleDelegate() = default;
}; };
typedef int BreakpointId; using BreakpointId = int;
} // namespace debug } // namespace debug
} // namespace v8 } // namespace v8
......
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