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

[regexp][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/regexp to 'using' declarations.

R=jgruber@chromium.org

Bug: v8:8834
Change-Id: I2765c3465fec7e8c42c3a84b924522f220ab5676
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1545904Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60585}
parent 38ddf33c
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
namespace v8 { namespace v8 {
namespace internal { namespace internal {
typedef unibrow::Mapping<unibrow::Ecma262Canonicalize> Canonicalize; using Canonicalize = unibrow::Mapping<unibrow::Ecma262Canonicalize>;
static bool BackRefMatchesNoCase(Isolate* isolate, int from, int current, static bool BackRefMatchesNoCase(Isolate* isolate, int from, int current,
int len, Vector<const uc16> subject, int len, Vector<const uc16> subject,
......
...@@ -1660,14 +1660,9 @@ static bool ShortCutEmitCharacterPair(RegExpMacroAssembler* macro_assembler, ...@@ -1660,14 +1660,9 @@ static bool ShortCutEmitCharacterPair(RegExpMacroAssembler* macro_assembler,
return false; return false;
} }
using EmitCharacterFunction = bool(Isolate* isolate, RegExpCompiler* compiler,
typedef bool EmitCharacterFunction(Isolate* isolate, uc16 c, Label* on_failure, int cp_offset,
RegExpCompiler* compiler, bool check, bool preloaded);
uc16 c,
Label* on_failure,
int cp_offset,
bool check,
bool preloaded);
// Only emits letters (things that have case). Only used for case independent // Only emits letters (things that have case). Only used for case independent
// matches. // matches.
......
...@@ -258,8 +258,8 @@ class DispatchTable : public ZoneObject { ...@@ -258,8 +258,8 @@ class DispatchTable : public ZoneObject {
class Config { class Config {
public: public:
typedef uc32 Key; using Key = uc32;
typedef Entry Value; using Value = Entry;
static const uc32 kNoKey; static const uc32 kNoKey;
static const Entry NoValue() { return Value(); } static const Entry NoValue() { return Value(); }
static inline int Compare(uc32 a, uc32 b) { static inline int Compare(uc32 a, uc32 b) {
......
...@@ -303,7 +303,7 @@ class RegExpCharacterClass final : public RegExpTree { ...@@ -303,7 +303,7 @@ class RegExpCharacterClass final : public RegExpTree {
NEGATED = 1 << 0, NEGATED = 1 << 0,
CONTAINS_SPLIT_SURROGATE = 1 << 1, CONTAINS_SPLIT_SURROGATE = 1 << 1,
}; };
typedef base::Flags<Flag> CharacterClassFlags; using CharacterClassFlags = base::Flags<Flag>;
RegExpCharacterClass( RegExpCharacterClass(
Zone* zone, ZoneList<CharacterRange>* ranges, JSRegExp::Flags flags, Zone* zone, ZoneList<CharacterRange>* ranges, JSRegExp::Flags flags,
......
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