Ignore:
Timestamp:
May 30, 2021, 9:11:40 AM (4 years ago)
Author:
Darin Adler
Message:

Remove WTF::Optional synonym for std::optional, using that class template directly instead
https://bugs.webkit.org/show_bug.cgi?id=226433

Reviewed by Chris Dumez.

Source/JavaScriptCore:

  • <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>.
  • inspector/scripts/codegen/generate_objc_protocol_types_implementation.py:

(ObjCProtocolTypesImplementationGenerator._generate_init_method_for_payload): Use auto instead
of Optional<>. Also use * instead of value() and nest the definition of the local inside an if
statement in the case where it's an optional.

  • inspector/scripts/tests/expected/*: Regenerated these results.

Source/WebCore:

  • <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>.

Source/WebCore/PAL:

  • <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>.

Source/WebDriver:

  • <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>.

Source/WebKit:

  • <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>.
  • Scripts/webkit/tests: Regenerated expected results, by running the command "python

Scripts/webkit/messages_unittest.py -r". (How am I supposed to know to do that?)

Source/WebKitLegacy/ios:

  • WebCoreSupport/WebChromeClientIOS.h: Let the do-webcore-rename script rename

Optional<> to std::optional<>.

Source/WebKitLegacy/mac:

  • <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>.

Source/WebKitLegacy/win:

  • <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>.

Source/WTF:

  • <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>.
  • wtf/Optional.h: Remove WTF::Optional.

Tools:

  • <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r278185 r278253  
    20592059}
    20602060
    2061 bool CodeBlock::hasOpDebugForLineAndColumn(unsigned line, Optional<unsigned> column)
     2061bool CodeBlock::hasOpDebugForLineAndColumn(unsigned line, std::optional<unsigned> column)
    20622062{
    20632063    const InstructionStream& instructionStream = instructions();
     
    34463446}
    34473447
    3448 Optional<CodeOrigin> CodeBlock::findPC(void* pc)
     3448std::optional<CodeOrigin> CodeBlock::findPC(void* pc)
    34493449{
    34503450    {
     
    34523452        if (auto* jitData = m_jitData.get()) {
    34533453            if (jitData->m_pcToCodeOriginMap) {
    3454                 if (Optional<CodeOrigin> codeOrigin = jitData->m_pcToCodeOriginMap->findPC(pc))
     3454                if (std::optional<CodeOrigin> codeOrigin = jitData->m_pcToCodeOriginMap->findPC(pc))
    34553455                    return codeOrigin;
    34563456            }
     
    34583458            for (StructureStubInfo* stubInfo : jitData->m_stubInfos) {
    34593459                if (stubInfo->containsPC(pc))
    3460                     return Optional<CodeOrigin>(stubInfo->codeOrigin);
     3460                    return std::optional<CodeOrigin>(stubInfo->codeOrigin);
    34613461            }
    34623462        }
    34633463    }
    34643464
    3465     if (Optional<CodeOrigin> codeOrigin = m_jitCode->findPC(this, pc))
     3465    if (std::optional<CodeOrigin> codeOrigin = m_jitCode->findPC(this, pc))
    34663466        return codeOrigin;
    34673467
     
    34703470#endif // ENABLE(JIT)
    34713471
    3472 Optional<BytecodeIndex> CodeBlock::bytecodeIndexFromCallSiteIndex(CallSiteIndex callSiteIndex)
    3473 {
    3474     Optional<BytecodeIndex> bytecodeIndex;
     3472std::optional<BytecodeIndex> CodeBlock::bytecodeIndexFromCallSiteIndex(CallSiteIndex callSiteIndex)
     3473{
     3474    std::optional<BytecodeIndex> bytecodeIndex;
    34753475    JITType jitType = this->jitType();
    34763476    if (jitType == JITType::InterpreterThunk || jitType == JITType::BaselineJIT)
Note: See TracChangeset for help on using the changeset viewer.