• Clemens Hammacher's avatar
    [wasm] Refactor wasm::Result type · d50ebde7
    Clemens Hammacher authored
    - Store std::string instead of std::unique_ptr<char[]> for the error
      message.
    - Remove ErrorCode, which was just kSuccess and kError anyway. Error is
      now detected on whether error_msg_ is empty or not.
    - Refactor constructors for perfect forwarding; this will allow us to
      implement Result<std::unique_ptr<X*>>.
    - Refactor Decoder::toResult for perfect forwarding.
    - Remove output operators (operator<<) for Result; it was only used in
      the error case anyway. Print error message directly instead.
      The operator was problematic since it assumed the existence of an
      output operator for every T which is used in Result<T>.
    - Remove ModuleError and FunctionError, introduce general static
      Result<T>::Error method instead.
    
    R=ahaas@chromium.org
    
    Change-Id: I1e0f602a61ee9780fee2a3ed33147d431fb092ba
    Reviewed-on: https://chromium-review.googlesource.com/472748
    Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
    Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#44518}
    d50ebde7
Name
Last commit
Last update
..
OWNERS Loading commit data...
decoder.h Loading commit data...
function-body-decoder-impl.h Loading commit data...
function-body-decoder.cc Loading commit data...
function-body-decoder.h Loading commit data...
leb-helper.h Loading commit data...
module-decoder.cc Loading commit data...
module-decoder.h Loading commit data...
signature-map.cc Loading commit data...
signature-map.h Loading commit data...
wasm-code-specialization.cc Loading commit data...
wasm-code-specialization.h Loading commit data...
wasm-debug.cc Loading commit data...
wasm-external-refs.cc Loading commit data...
wasm-external-refs.h Loading commit data...
wasm-interpreter.cc Loading commit data...
wasm-interpreter.h Loading commit data...
wasm-js.cc Loading commit data...
wasm-js.h Loading commit data...
wasm-limits.h Loading commit data...
wasm-macro-gen.h Loading commit data...
wasm-module-builder.cc Loading commit data...
wasm-module-builder.h Loading commit data...
wasm-module.cc Loading commit data...
wasm-module.h Loading commit data...
wasm-objects.cc Loading commit data...
wasm-objects.h Loading commit data...
wasm-opcodes.cc Loading commit data...
wasm-opcodes.h Loading commit data...
wasm-result.cc Loading commit data...
wasm-result.h Loading commit data...
wasm-text.cc Loading commit data...
wasm-text.h Loading commit data...